Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# URI格式在c中不受支持#_C#_Asp.net_Path - Fatal编程技术网

C# URI格式在c中不受支持#

C# URI格式在c中不受支持#,c#,asp.net,path,C#,Asp.net,Path,我正在尝试将数据插入到xml文件中。xml文件位置 路径:http://AutoCompleteInGridView%20new1/Design/Pro/pricelist.xml。 插入数据时出现错误不支持URI格式。 它显示未处理参数异常。我想保存我的xml 文件位于服务器系统中。这些url属于服务器路径位置。 谁能给我一个建议或链接来解决这些问题 以下是错误: 使用此示例: string uriPath = "YourAddress/pricelist.xm

我正在尝试将数据插入到xml文件中。xml文件位置 路径:
http://AutoCompleteInGridView%20new1/Design/Pro/pricelist.xml
。 插入数据时出现错误
不支持URI格式
。 它显示未处理参数异常。我想保存我的xml 文件位于服务器系统中。这些url属于服务器路径位置。 谁能给我一个建议或链接来解决这些问题

以下是错误:

使用此示例:

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

您可以尝试使用此解决方案:

基本上,使用

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;

检查这个问题,因为它可能会有所帮助。感谢您的回复。在该链接中,它提供了本地路径的解决方案,但我需要服务器路径。你能给我一个链接吗?同样的概念也适用,见下面的答案。您需要创建字符串变量并将其传递到URI。我的操作与下面的回答完全相同,但它显示了相同的错误“不支持URI格式”为什么不使用linq to xml?请不要使用“仅链接”回答。在这里发布答案的概要。嗨,Shahrooz,这是本地路径,但我需要服务器路径的解决方案。你能给我一个建议吗。谢谢Jefri,我只想将我的xml文件保存在我当前文件夹之外。就像服务器系统中的E:\xmlfile Hi Shahrooz,请找到上面的图片并给我一个建议。我被困在这里了。