老外编的程序(二)--System.Net的示例程序

<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
using System;
using System.Net;
using System.Text;
using System.Collections.Specialized;

public class WebClientSample
{
    public static void Main()
    {
        try {
            
        // Download the data to a buffer
               WebClient client = new WebClient();

          Byte[] pageData = client.DownloadData("http://www.microsoft.com");
        string pageHtml = Encoding.ASCII.GetString(pageData);
        Console.WriteLine(pageHtml);

        // Download the data to a file
                client.DownloadFile("http://www.bn.com", "page.htm");

        // Upload some form post values
        NameValueCollection form = new NameValueCollection();        
        form.Add("MyName", "MyValue");        
        Byte[] responseData = client.UploadValues("http://localhost/somefile.aspx", form);        

        }
        catch (WebException webEx) {
              Console.WriteLine(webEx.ToString());
               if(webEx.Status == WebExceptionStatus.ConnectFailure) {
                   Console.WriteLine("Are you behind a firewall?  If so, go through the proxy server.");
               }
        }
    }       &n
11AJ3c323021614.jpg
seover="window.status='正文--老外编程序(二)--System.Net的示例程序';return true">
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
阅读更多
个人分类: .net
想对作者说点什么? 我来说一句

老外编的kriging插值

2018年02月17日 112KB 下载

数据库连接示例程序

2009年07月22日 28KB 下载

S7-200锅炉程序

2014年09月18日 33KB 下载

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭