日期:2014-05-20  浏览次数:20784 次

写文件出错
Stream   receiveStream   =   oResp.GetResponseStream();
StreamReader   readStream   =   new   StreamReader(receiveStream,   Encoding.Default);
string   SourceCode   =   readStream.ReadToEnd();
readStream.Close();
if   (SourceCode.Contains( "btchina.net/download.php "))
{
        return;
}
else
{
        byte[]   stream   =   new   byte[oResp.ContentLength];
        int   read   =   receiveStream.Read(stream,   0,   stream.Length);
        FileStream   fs   =   new   FileStream(TorrentFile,   FileMode.Create,   FileAccess.Write);//执行到这句出错

        while   (read   >   0)
        {
                fs.Write(stream,   0,   read);
                read   =   receiveStream.Read(stream,   0,   read);
        }
        fs.Close();
}

------解决方案--------------------
报什么错啊?是不是TorrentFile的内容不对,比如\等字符没有处理?
------解决方案--------------------
TorrentFile怎么定义的 你调一下看看各个参数是什么