簡體   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