|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
数据挖掘有点高深的,主要估计就是使用一些算法提取一些实用的数据。学好数据挖掘的话可以应聘baidu或者google,但是一般人家对算法的要求听高的。你最好还是学点应用型的吧。这种主要是研究型的。asp.net|多线程System.IO.StreamiStream=null;
//Buffertoread10Kbytesinchunk:
byte[]buffer=newByte[10240];
//Lengthofthefile:
intlength;
//Totalbytestoread:
longdataToRead;
//Identifythefiletodownloadincludingitspath.
stringfilepath=@"E:softwareSQLServer2000PersonalEdition.ISO";
//Identifythefilename.
stringfilename=System.IO.Path.GetFileName(filepath);
try
{
//Openthefile.
iStream=newSystem.IO.FileStream(filepath,System.IO.FileMode.Open,
System.IO.FileAccess.Read,System.IO.FileShare.Read);
Response.Clear();
//Totalbytestoread:
dataToRead=iStream.Length;
longp=0;
if(Request.Headers["Range"]!=null)
{
Response.StatusCode=206;
p=long.Parse(Request.Headers["Range"].Replace("bytes=","").Replace("-",""));
}
if(p!=0)
{
Response.AddHeader("Content-Range","bytes"+p.ToString()+"-"+((long)(dataToRead-1)).ToString()+"/"+dataToRead.ToString());
}
Response.AddHeader("Content-Length",((long)(dataToRead-p)).ToString());
Response.ContentType="application/octet-stream";
Response.AddHeader("Content-Disposition","attachment;filename="+System.Web.HttpUtility.UrlEncode(Request.ContentEncoding.GetBytes(filename)));
iStream.Position=p;
dataToRead=dataToRead-p;
//Readthebytes.
while(dataToRead>0)
{
//Verifythattheclientisconnected.
if(Response.IsClientConnected)
{
//Readthedatainbuffer.
length=iStream.Read(buffer,0,10240);
//Writethedatatothecurrentoutputstream.
Response.OutputStream.Write(buffer,0,length);
//FlushthedatatotheHTMLoutput.
Response.Flush();
buffer=newByte[10240];
dataToRead=dataToRead-length;
}
else
{
//preventinfiniteloopifuserdisconnects
dataToRead=-1;
}
}
}
catch(Exceptionex)
{
//Traptheerror,ifany.
Response.Write("Error:"+ex.Message);
}
finally
{
if(iStream!=null)
{
//Closethefile.
iStream.Close();
}
Response.End();
}
我觉得很重要,一般所说的不重要应该指的是:你学好一种以后再学另一种就很容易了。(因为这样大家可能有一个错觉就是语言不是很重要,只要随便学一种就可以了,其实不是这样的。 |
|