日期:2014-05-17 浏览次数:20876 次
int DownloadTime =0;
private void btnSave_Click(object sender, System.EventArgs e)
{
this.timer1.Enabled = true;
byte[] inf = WebServer.NewObject.GetUser();
System.Text.Encoding ed = System.Text.Encoding.GetEncoding("GBK");
string s = ed.GetString(inf, 0, inf.Length);
string path = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName) + "\\s_user.txt";
FileStream fs = new FileStream(path, FileMode.Create, FileAccess.Write);
StreamWriter sw = new StreamWriter(fs, Encoding.GetEncoding("GBK"));
sw.WriteLine(s);
sw.Close();
fs.Close();
this.timer1.Enabled = false;
}
private void timer1_Tick(object sender, EventArgs e)
{
this.lblNews.Text = "正在下载用户信息,请等待..." + DownloadTime;
DownloadTime += 1;
// this.Refresh();
}