2013-02-26 2 views
0

하나의 작은 간단한 문자열이있는 웹 페이지를 설정하고 싶습니다. 이미지 없음, CSS 없음, 다른 것은 없습니다. 매우 길지 않은 평범한 문자열 (최대 20 자).웹 페이지에서 C# 양식 응용 프로그램으로 문자열 가져 오기

이 문자열을 C# Form 응용 프로그램과 함께 가져 와서 프로그램의 다양한 용도로 사용할 수있는 가장 좋은 방법은 무엇입니까? 예를 들어 부팅 할 때 소프트웨어의 최신 버전을 사람들에게 보여주는 것과 같은 것입니다.

답변

1

나는이 같은 System.Net.WebClient에게 자신을 사용하십시오 :

using (var client = new WebClient()) 
{ 
    string result = client.DownloadString("http://www.test.com"); 
    // TODO: do something with the downloaded result from the remote 
} 
0

System.Net.WebClient 사용해보십시오 :

 string remoteUri = "http://www.myserver.com/mypage.aspx"; 
     WebClient myWebClient = new WebClient(); 
     string version = myWebClient.DownloadString(remoteUri); 
관련 문제