C# ÖÐÔõÑù½«·þÎñÆ÷¶ËµÄÎļþÏÂÔØµ½¿Í»§¶Ë
C# ÖÐÔõÑù½«·þÎñÆ÷¶ËµÄÎļþÏÂÔØµ½¿Í»§¶Ë
ʲôÒâ˼°¡£¬VS±£»¤µÄÎļþÄãÊÇûÓа취Ï嵀 °¡
±ðµÄÖîÈçһЩÊÓÆµ£¬Í¼Æ¬£¬Ñ¹Ëõ°ü¶¼¿ÉÒÔͨ¹ýÁ÷½øÐÐÏÂÔØµÄ°¡
簡單µÄ¾Í <A>
˵Çå³þÎÊÌâ¡£
C# code:
public bool downfile(string url,string LocalPath)
{
try
{
Uri u = new Uri(url);
HttpWebRequest mRequest = (HttpWebRequest)WebRequest.Create(u);
mRequest.Method = "GET";
mRequest.ContentType = "application/x-www-form-urlencoded";
HttpWebResponse wr = (HttpWebResponse)mRequest.GetResponse();
Stream sIn = wr.GetResponseStream();
FileStream fs = new FileStream(LocalPath, FileMode.Create, FileAccess.Write);
long length = wr.ContentLength;
long i = 0;
decimal j=0;
while (i < length)
{
byte[] buffer = new byte[1024];
i += sIn.Read(buffer, 0, buffer.Length);
fs.Write(buffer, 0, buffer.Length);
if((i % 1024)==0)
{
j=Math.Round(Convert.ToDecimal((Convert.ToDouble(i)/Convert.ToDouble(length))*100),4);
statusBar1.Text="µ±Ç°ÏÂÔØÎļþ´óС:"+length.ToString()+"×Ö½Ú µ±Ç°ÏÂÔØ´óС:"+i+"×Ö½Ú ÏÂÔØ½ø¶È"+j.ToString()+"%";
}
else
{
statusBar1.Text="µ±Ç°ÏÂÔØÎļþ´óС:"+length.ToString()+"×Ö½Ú µ±Ç°ÏÂÔØ´óÐ
Ïà¹ØÎÊ´ð£º
ÔÚC#ÖÐÔõô°ÑÒ»¸öExcel±£´æ³ÉΪһ¸öHtmlÎļþ?
ÈçͬÔÚExcelÖÐ Îļþ——±£´æÎª——¸ñʽѡΪhtml Éú³ÉµÄÎļþ ¼°Îļþ¼Ð£¨ÔÚ¶àÕÅsheet ʱ£©
ÒýÓÃ
excelapp.Workbooks[1].PublishObjects ......
ÎÒÔÚform1ÖеÄij¸ö·½·¨ÈÃform2´°Ìå³öÏÖ
ÄÇôÕâ¸öʱºòÔõô¹Ø±Õform1¶ø²»¹Ø±Õform2ÄØ£¿
Form2 f=new Form2();
f.Show();
this.Close();
ÒýÓÃ
Form2 f=new Form2();
f.Show();
this.Close();
ÕâÑùµÄ»°Õû¸ö³Ì ......
ÎÒµÄajaxµÄupdatepanel¿Ø¼þÀïµÄÃæ²»ÄÜÖ´ÐÐresponse.write£¬¿ÉÊÇÎÒÐèÒªµ¯³ö¶Ô»°¿ò£¬ÎÒÒªÔõô×öÄØ£¿
ÓÐûÓв»ÐèÒªresponse.writeµ¯Ìáʾ¿òµÄ×ö·¨ÄØ£¿
ÁíÍâÎÒµÄÒ³ÃæÉÏÓÐÒ»¸öwebÓû§¿Ø¼þ£¬È»ºó·ÅÒ»¸ögridviewÔÚupdatepa ......
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Syst ......