webClient.DownloadFile错误:远程服务器返回错误:(500)内部服务器错误。 [英] webClient.DownloadFile error : The remote server returned an error: (500) Internal Server Error.
问题描述
我只是想通过嵌入式服务器应用程序使用下面的代码下载mp4文件;
http:/ / videovlt是位于虚拟PC下的服务器应用程序。以下代码在我的电脑上运行的嵌入式服务器应用程序上运行。
spath =http:// videovlt / videos / 7bf9d10b-4006-4b44- 9626-e3751df2f4ce.mp4
fpath =E:\ videos\7bf9d10b-4006-4b44-9626-e3751df2f4ce.mp4
Hi,
I just simply want to download an mp4 file via embedded server application using the code below;
http://videovlt is server application which is located under virtual pc. and the code below runs on an embedded server application which is running under my pc.
spath = "http://videovlt/videos/7bf9d10b-4006-4b44-9626-e3751df2f4ce.mp4"
fpath = "E:\videos\7bf9d10b-4006-4b44-9626-e3751df2f4ce.mp4"
webClient.DownloadFile(spath, fpath);
但它给出了远程服务器返回错误:(500)内部服务器错误。
错误!
这是什么原因?
我尝试添加这个但是没有工作;
webClient.Headers.Add(用户代理,Mozilla / 5.0(Windows; U; MSIE 9.0; Windows NT 9.0; en-US));
But it gives "The remote server returned an error: (500) Internal Server Error."
error!
What is the reason for this?
I tried adding this but didn't work;
webClient.Headers.Add("user-agent", "Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)");
推荐答案
问题是源mp4 url在被嵌入式服务器占用之前被破坏了。
The problem was source mp4 url was getting broken before consumed by embedded server.
这篇关于webClient.DownloadFile错误:远程服务器返回错误:(500)内部服务器错误。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!