惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
SegmentFault 最新的问题
Y
Y Combinator Blog
Recorded Future
Recorded Future
博客园 - Franky
I
InfoQ
T
The Blog of Author Tim Ferriss
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
P
Palo Alto Networks Blog
G
GRAHAM CLULEY
Cloudbric
Cloudbric
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
MongoDB | Blog
MongoDB | Blog
F
Full Disclosure
Google DeepMind News
Google DeepMind News
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Check Point Blog
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
T
Threat Research - Cisco Blogs
U
Unit 42
N
Netflix TechBlog - Medium
The Cloudflare Blog
Spread Privacy
Spread Privacy
Microsoft Azure Blog
Microsoft Azure Blog
美团技术团队
T
Troy Hunt's Blog
Engineering at Meta
Engineering at Meta
H
Heimdal Security Blog
TaoSecurity Blog
TaoSecurity Blog
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tenable Blog
B
Blog
S
Securelist
H
Hacker News: Front Page
Google Online Security Blog
Google Online Security Blog
G
Google Developers Blog

博客园 - sh37

Newtonsoft中的几个妙用 Mvc中ViewData与TempData的区别 Silverlight中利用ListBox特性实现单选按钮组RadioButtonList和复选按钮组CheckBoxList的功能 SilverLight中Page也可使用泛型基类 cookie操作 - sh37 - 博客园 C# 利用net 命令获取域用户列表 - sh37 利用MessageQueue收发消息 - sh37 - 博客园 使用ASP获得AD帐号 “域\用户名” - sh37 - 博客园 使用ASP.NET获得AD帐号 - sh37 - 博客园 根據xml文檔數據 給DataTable增加行 JS获取剪贴板内容的代码 - sh37 - 博客园 分页时使当前页码变色 C#生成缩略图 自動生成帶文字的圖片 常用pl/sql vb.net後台抓取網頁內容 ServerVariables集合内容列表 如何动态创建一个按纽 并给这个按纽绑上一个Onclick事件 17种常用正则表达式
C# xmlhttp - sh37 - 博客园
sh37 · 2007-07-27 · via 博客园 - sh37

 //引入com microsoft.xml.3.0
    //using MSXML2;
    public void GetCon(String Url)
    {
    //    string vs = "";
    //    try
    //    {
    //        ArrayList arr = new ArrayList();
    //        XMLHTTP XmlHttp = new MSXML2.XMLHTTPClass();            ;

    //        XmlHttp.open("get", url,false, null, null);
    //        XmlHttp.send(null);

    //        if (XmlHttp.readyState == 4)
    //        {
    //            vs = XmlHttp.responseText;
    //        }
    //    }
    //    catch { }
    //    return vs;

        string StringFileName = Url.Substring(Url.LastIndexOf("/") + 1);
        string StringFilePath = Request.PhysicalApplicationPath;
        if (!StringFilePath.EndsWith("/")) StringFilePath += "/";
        MSXML2.XMLHTTP _xmlhttp = new MSXML2.XMLHTTPClass();
        _xmlhttp.open("GET", Url, false, null, null);
        _xmlhttp.send("");
        if (_xmlhttp.readyState == 4)
        {
            if (System.IO.File.Exists(StringFilePath + StringFileName))
                System.IO.File.Delete(StringFilePath + StringFileName);
            System.IO.FileStream fs = new System.IO.FileStream(StringFilePath + StringFileName, System.IO.FileMode.CreateNew);
            System.IO.BinaryWriter w = new System.IO.BinaryWriter(fs);
            w.Write((byte[])_xmlhttp.responseBody);
            w.Close();
            fs.Close();
            Response.Write("文件已经得到。<br><a href='" + Request.ApplicationPath + StringFileName + "' target='_blank'>");
            Response.Write("查看" + StringFileName + "</a>");
        }
        else
            Response.Write(_xmlhttp.statusText);
        Response.End();


   }