国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

老外編的程序(八):在CSharp里面使用Http Get方法

2024-07-21 02:16:35
字體:
來源:轉載
供稿:網友

/author: duncan mackenzie
using system;
using system.net;
using system.io;

namespace makeagetrequest_charp
{
    /// <summary>
    /// summary description for class1.
    /// </summary>
    class class1
    {
        static void main(string[] args)
        {
            string surl;
            surl = "http://www.microsoft.com";

            webrequest wrgeturl;
            wrgeturl = webrequest.create(surl);
            
            webproxy myproxy = new webproxy("myproxy",80);
            myproxy.bypassproxyonlocal = true;

            wrgeturl.proxy = webproxy.getdefaultproxy();

            stream objstream;
            objstream = wrgeturl.getresponse().getresponsestream();

            streamreader objreader = new streamreader(objstream);

            string sline = "";
            int i = 0;

            while (sline!=null)
            {
                i++;
                sline = objreader.readline();
                if (sline!=null)
                    console.writeline("{0}:{1}",i,sline);
            }
            console.readline();
        }
    }
}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 伊宁市| 策勒县| 寻乌县| 武强县| 万全县| 延庆县| 泊头市| 九台市| 永城市| 仲巴县| 龙海市| 扶沟县| 舞阳县| 辽宁省| 娄底市| 阳山县| 阿拉善右旗| 渭源县| 杨浦区| 青川县| 黑龙江省| 高碑店市| 偃师市| 延川县| 辽阳市| 龙江县| 厦门市| 江阴市| 馆陶县| 钟祥市| 新绛县| 林周县| 韶关市| 嘉荫县| 德安县| 镇雄县| 阆中市| 佛山市| 仪征市| 永定县| 凤冈县|