62,046
社区成员
发帖
与我相关
我的任务
分享
public string[] bb = new string[1000];
public static int w;
protected void Button1_Click(object sender, EventArgs e)
{
w = 0;
for (qq = 1; qq <= 5; qq++)
{
Thread thread = new Thread(new ThreadStart(add));
thread.Start();
}
eeee();
}
void add()
{
string str = Encoding.Default.GetString(myBytes);
myClient.Dispose();
string pattern = @"(?si)(?<=\bhref\s*=\s*"")[^""]+(?="")";
string[] ss = new string[Regex.Matches(str, pattern).Count + 1];//ss 长度不固定,
string[] aa = new string["aa","bb","cc","dd","ee","ff","gg","hh","ii","jj"];
for (int i = 0; i < ss.Length; i++)
{
if (ss[i].Equals(""))
{
bb[w] = aa[i];
w++;
}
}
}
void eeee()
{
System.Text.StringBuilder myTables = new StringBuilder();
for (int ii = 0; ii < bb.Length; ii++)
{
myTables.Append(bb[ii] + "\r\n");
}
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.Charset = "GB2312";
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=test.txt");
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");//设置输出流为简体中文
HttpContext.Current.Response.ContentType = "application/ms-excel";//设置输出文件类型为excel文件。
HttpContext.Current.Response.Write(myTables);
HttpContext.Current.Response.End();
}