繁体   English   中英

C#不支持URI格式

[英]URI formats are not supported in c#

我正在尝试将数据插入到xml文件中。 xml文件的位置路径: http://AutoCompleteInGridView%20new1/Design/Pro/pricelist.xml 插入我的数据时,出现错误URI formats are not supported 它显示参数异常未处理。我想将我的xml文件保存在server system这些URL属于ServerPath位置。 谁能给我一个建议或链接来解决这些问题。

这是错误:

在此处输入图片说明

使用此示例:

                string uriPath = "YourAddress/pricelist.xml";
                string  localPath = new Uri(uriPath).LocalPath;

您可以尝试以下解决方案:

http://social.msdn.microsoft.com/Forums/zh-CN/eccd585a-ac2b-4700-aa28-abb4802cd3a5/uri-formats-are-not-supported-error-with-xmlsave?forum=xmlandnetfx

基本上,使用

doc.Save(Server.MapPath("~/EEPPriceList/Products.xml"))

尝试这样:

string SavePathUrl = ConfigurationManager.AppSettings["SavePathUrl"];
string strFileName = DateTime.Now.ToString("dd-mmm-yyyy-hh-mm-ss-ffffff") + "^" + fileName;
File.WriteAllBytes(new Uri(SavePathUrl).AbsoluteUri + strFileName, Convert.FromBase64String(base64String));
return strFileName;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM