http://imgc.zol.com.cn/small_flash_channel/shoot/21ssssaq.swf
这个flash的url,我是从51flash网站找到的。但我用webclient下载却下载不下来,这个swf的文件直接在ie中访问,也是出来403错误。
可是51flash网上,为什么可以播放这个flash呢?网址如下
http://www.51flash.com/play_detail_451674.html
这个flash的url,我是从51flash网站找到的。但我用webclient下载却下载不下来,这个swf的文件直接在ie中访问,也是出来403错误。
可是51flash网上,为什么可以播放这个flash呢?网址如下
http://www.51flash.com/play_detail_451674.html
private void button1_Click_1(object sender, EventArgs e)
{
string URLAddress = "http://imgc.zol.com.cn/small_flash_channel/shoot/21ssssaq.swf";
try
{
WebRequest myre = WebRequest.Create(URLAddress);
}
catch (WebException exp)
{ MessageBox.Show(exp.Message, "Error");
} WebClient client = new WebClient();
client.DownloadFile(URLAddress, "c:\a.swf");
Stream str = client.OpenRead(URLAddress);
byte[] mbyte = new byte[100000];
int allmybyte = (int)mbyte.Length;
int startmbyte = 0;
while(allmybyte>0)
{
int m = str.Read(mbyte,startmbyte,allmybyte);
if(m==0)
break;
startmbyte+=m;
allmybyte-=m;
}
FileStream fstr = new FileStream(@"c:\a.swf",FileMode.OpenOrCreate,FileAccess.Write);
fstr.Write(mbyte,0,startmbyte);
str.Close();
fstr.Close();
}
我的程序如果这样写的话,下载其它远程的文件是可以。但这个flash就是不可以 private void button1_Click_1(object sender, EventArgs e)
{
string URLAddress = "http://imgc.zol.com.cn/small_flash_channel/shoot/21ssssaq.swf";
WebClient client = new WebClient();
client.DownloadFile(URLAddress, @"c:\a.swf"); }
但就是奇怪,为什么用讯雷就可以下载呢?