问题描述
你好,
我写了这段代码它给出了错误路径中的非法字符。
Hello,
I have written this code it is giving error "Illegal characters in path."
WebClient client = new WebClient();
string Path = @"111.11.111.111:111\abc\abc\abc\";
Byte[] buffer = client.DownloadData(Path + lblresult.Text);
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", buffer.Length.ToString());
Response.BinaryWrite(buffer);
请帮助..............
please Help..............
推荐答案
文件夹是在服务器上,我想访问...那是一个IP地址...
Folder is on server and i want to access that... and that is a IP address...
我再次重复:':'是路径的无效字符。
这是你的问题:不要将 URI scheme 与URI的其他元素混淆,了解哪个部分是什么:
[],
[],
[]。
最后引用的文章包含允许的字符。
I repeat once again: ':' is and invalid character for path.
Here is your problem: don't mix up URI scheme with other elements of URI, learn what part is what:
http://en.wikipedia.org/wiki/URI_scheme[^],
http://en.wikipedia.org/wiki/Uniform_resource_identifier[^],
http://en.wikipedia.org/wiki/Uniform_resource_locator[^].
Last referenced article contains allowed characters.
这篇关于路径中的非法字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!