不如
有一个asp或aspx页在服务器上
页面上有一个文字A
现在在WINDOWS应用程序里怎么访问到这个页面的A并得到A
以前DELPHI里可以做到
现在C#里不知道怎么做才可以
谢谢
分不够再加

解决方案 »

  1.   

    下面的示例说明如何创建 WebRequest 实例并返回响应。using System;
    using System.IO;
    using System.Net;
    using System.Text;namespace Examples.System.Net
    {
        public class WebRequestGetExample
        {
            public static void Main ()
            {
                // Create a request for the URL. 
                WebRequest request = WebRequest.Create ("http://www.contoso.com/default.html");
                // If required by the server, set the credentials.
                request.Credentials = CredentialCache.DefaultCredentials;
                // Get the response.
                HttpWebResponse response = (HttpWebResponse)request.GetResponse ();
                // Display the status.
                Console.WriteLine (response.StatusDescription);
                // Get the stream containing content returned by the server.
                Stream dataStream = response.GetResponseStream ();
                // Open the stream using a StreamReader for easy access.
                StreamReader reader = new StreamReader (dataStream);
                // Read the content.
                string responseFromServer = reader.ReadToEnd ();
                // Display the content.
                Console.WriteLine (responseFromServer);
                // Cleanup the streams and the response.
                reader.Close ();
                dataStream.Close ();
                response.Close ();
            }
        }
    }
      

  2.   

    WebClient client = new WebClient();
    Stream sm = client.OpenRead("URL");
    SreateReader rd = new StreamReader(sm);
    a = rd.ReadToEnd();
    rd.close();
    sm.close();
      

  3.   

    有个csdn 浏览助手,通过客户端软件然后读取web服务器.达到同样效果建议你参考那个.
      

  4.   

    webrequest/webclinet这些都可以。楼主是做Web Services?还是实现类似的功能,建议看看web Service的书