gpt4 book ai didi

.Net 问题 "Illegal characters in path."

转载 作者:行者123 更新时间:2023-12-01 22:45:22 25 4
gpt4 key购买 nike

大家好,我不是 .net 开发人员,我有 PHP、Python 背景,但我不确定该怎么做。

我在尝试加载我们的网站之一时出现以下错误。请有人帮忙


[ArgumentException:路径中的非法字符。]
System.IO.Path.CheckInvalidPathChars(字符串路径)+7491109
System.IO.Path.GetFileName(字符串路径)+19
System.IO.FileStream..ctor(String路径,FileMode方式,FileAccess访问,FileShare共享,Int32 bufferSize) +16
System.Xml.XmlDownloadManager.GetStream(Uri uri,ICredentials 凭据)+77
System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) +54
System.Xml.XmlTextReaderImpl.OpenUrlDelegate(对象 xmlResolver)+74
System.Threading.CompressedStack.runTryCode(对象用户数据)+70
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode代码,CleanupCode backoutCode,Object userData)+0
System.Threading.CompressedStack.Run(CompressedStack compressedStack,ContextCallback 回调,对象状态)+108
System.Xml.XmlTextReaderImpl.OpenUrl() +186
System.Xml.XmlTextReaderImpl.Read() +208
System.Xml.XPath.XPathDocument.LoadFromReader(XmlReader 阅读器,XmlSpace 空间)+217
System.Xml.XPath.XPathDocument..ctor(String uri, XmlSpace 空间) +116
System.Xml.XPath.XPathDocument..ctor(String uri) +6
OpenBay.Utils.XPathUtils.GetNodes(字符串 xpathQuery,字符串 xmlFile)+30
OpenBay.Wms.Controllers.SiteController.SetErrorPages(站点) +21
OpenBay.Wms.Controllers.SiteController.GetSite(Uri uri, DirectoryInfo dir, String applicationName) +104
OpenBay.Wms.HttpModule.UrlProcessHttpModule.GetSiteParameters(HttpApplication 应用程序,RequestInfo 信息)+172
OpenBay.Wms.HttpModule.UrlProcessHttpModule.ProcessRequest(Object o, EventArgs args) +338
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75



谢谢大家

最佳答案

您的代码将调用 System.IO.Path.CheckInvalidPathChars,它会依次检查以下内容:

  1. 双引号 (")

  2. 左尖括号 (<)

  3. 右尖括号 (>)

  4. 竖线(|)

以及小于 32 位十进制(空格)的控制字符。

因此请确保您的路径不包含它们。

编辑: comment from Guy Lowe

my issue was my unescaped \ in c:\ making it c:\ fixed it

关于.Net 问题 "Illegal characters in path.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1741560/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com