分类: 系统运维
2008-03-10 01:29:14
private void button1_Click(object sender, System.EventArgs e)
{ string DownFileName =@"mk:@MSITStore:http://blogimg.chinaunix.net/blog/upfile2/080302215945.chm::/fat5.htm"; string SaveFileName = @"C:\11.html"; MSXML2.XMLHTTPClass _xmlHttp = new MSXML2.XMLHTTPClass(); _xmlHttp.open("GET",DownFileName,false,null,null); _xmlHttp.send(null); if( _xmlHttp.readyState == 4 )
{ if(System.IO.File.Exists(SaveFileName)) System.IO.File.Delete(SaveFileName); System.IO.FileStream fs = new System.IO.FileStream(SaveFileName, System.IO.FileMode.CreateNew); System.IO.BinaryWriter w = new System.IO.BinaryWriter(fs); w.Write((byte[])_xmlHttp.responseBody); w.Close(); fs.Close(); } }