路径中具有非法字符?这是什么问题

路径中具有非法字符?这是什么问题

社区

.NET Framework 帖子详情 路径中具有非法字符?这是什么问题 billydong 2003-06-12 06:18:04 在Win98下运行WinForm程序,出现如下异常:

System.ArgumentException: 路径中具有非法字符。

at System.Security.Permissions.FileIOPermission.HasIllegalCharacters(String[] str)

at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath)

at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path)

at System.AppDomainSetup.get_ConfigurationFile()

at System.Configuration.DefaultConfigurationSystem.get_AppConfigPath()

at System.Configuration.DefaultConfigurationSystem.System.Configuration.IConfigurationSystem.Init()

at System.Configuration.ConfigurationSettings.SetConfigurationSystem(IConfigurationSystem configSystem)

at System.Configuration.ConfigurationSettings.GetConfig(String sectionName)

at System.Web.Services.Configuration.WebServicesConfiguration.get_Current()

at System.Web.Services.Protocols.SoapClientType..ctor(Type type)

at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()

at StockClient.StockService.StockService..ctor()

at Wizard.App.TBStock.StockClient..ctor()

at Wizard.App.TBStock.WinUI.Forms.BonusComputParamForm..ctor()

at Wizard.App.TBStock.WinUI.BonusCalculateFrame.ProcessDatePoint(Boolean isNew)

at Wizard.App.TBStock.WinUI.BonusCalculateFrame.BarListItemViewDate_ItemClick(Object sender, ItemClickEventArgs e)

at Wizard.WzdBars.BarItem.OnClick(BarItemLink link)

at Wizard.WzdBars.BarListItem.SubItemClick(Object sender, ItemClickEventArgs e)

at Wizard.WzdBars.BarItem.OnClick(BarItemLink link)

at Wizard.WzdBars.BarButtonItem.OnClick(BarItemLink link)

at Wizard.WzdBars.BarItem.OnClickCore(BarItemLink link)

at Wizard.WzdBars.BarItemLink.OnClickLink()

at Wizard.WzdBars.Controls.CustomBarControl.OnMouseUp(MouseEventArgs e)

at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

at System.Windows.Forms.Control.WndProc(Message& m)

at Wizard.WzdBars.Controls.CustomBarControl.WndProc(Message& msg)

at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

请问这是什么原因

...全文

3147 9 打赏 收藏 路径中具有非法字符?这是什么问题 在Win98下运行WinForm程序,出现如下异常: System.ArgumentException: 路径中具有非法字符。 at System.Security.Permissions.FileIOPermission.HasIllegalCharacters(String[] str) at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, String[] pat 复制链接

扫一扫 分享 转发到动态 举报 AI 作业

写回复 配置赞助广告取 消

确 定

用AI写文章 9 条回复 切换为时间正序 请发表友善的回复… 发表回复 打赏红包 需支付: 0.00 元 取 消 确 定 billydong 2003-06-21 打赏举报 回复 问题已解决,98的UNICODE问题,谢谢诸位册参与 NaZiChong 2003-06-21 打赏举报 回复 98下你的应用程序的路径最好不要含有中文(双字节字符),否则就会出现这种错误!特别是使用DataGrid,如果有中文,98下bug多多!

建议将路径中双字节字符全部去掉!

rabbitwy 2003-06-20 打赏举报 回复 看看你的代码啊 lbx1979 2003-06-19 打赏举报 回复 代码的问题,贴代码 colin666 2003-06-19 打赏举报 回复 MARK fys 2003-06-18 打赏举报 回复 使用@所后面的字符全面原样引用 billydong 2003-06-13 打赏举报 回复 这是在客户端初始化WEB引用时出现的 jlhdlj 2003-06-13 打赏举报 回复 大概是用了转义字符 CMIC 2003-06-12 打赏举报 回复 代码贴出来 c#中文件路径出现非法字符怎么办?解决也容易 c#中如果需要生成文件路径,有时会抛出“文件路径中出现非法字符”的异常,这时我们就会找到这个非法的字符串,然后Replace替换掉。其实net类库提供了非法字符的数组,我们直接循环替换掉即可,简单粗爆,性能上也不会有什么损失。这里还有个小窍门,net类库提供了文件和文件夹的两个非法字符的数组,我们拼接文件完整路径的时候,都可以用上。 mysql提示路径有非法字符,如何解决路径此异常非法字符? i am displaying images from url using xml parsing,some images are displaying very well,some time i got exception likeIllegal character in path at index 113: http://www.theblacksheeponline.com/party_im... 解决VA出现Files 的值“<<<<<<< .mine”无效。路径中具有非法字符问题 Files 的值“<<<<<<< .mine”无效。路径中具有非法字符。

一般出现在svn托管代码的更新与上传过程中导致的!

解决方案:

方法一:

把源代码中所有页面中的非法字符删掉。根据错误提示的页面来找到非法字符,然后删掉它。一般这样就不会有错误了。如果还有错误提示:“Files 的值“ < < < < < < < .mine”无效路径中具有非法字符”,而且又找不到源代码中的路径,那么就尝试方法二的解决办法。

使用Visual Studio 部署SharePoint时提示“路径中具有非法字符”

使用Visual Studio 部署SharePoint时提示“路径中具有非法字符”

在使用VS 2012部署或发布SharePoint时,提示“路径中具有非法字符”(英文提示“Illegal characters in path”),找了半天,才找到答案。

这个原因是路径中含有中文或者特殊字符导致的。比如使用Windows 8 live帐... VS配置QtTools的路径时报“路径中具有非法字符”错误 今天给一台新的电脑配置VS2015+Qt5.10.1开发环境时,在vs中设置qtTools路径时报错。Win+R打开cmd。然后输入Regedit命令,进入注册表。然后vs就可以正常添加路径了。(注:VS不重启也可以)其实之前也遇到过,这次刚好就记录一下吧。添加一个【字符串值(s)】

.NET Framework

17,747

社区成员

24,327

社区内容

发帖 与我相关 我的任务 .NET Framework .NET技术 .NET Framework 复制链接

扫一扫 分享 确定 社区描述 .NET技术 .NET Framework 社区管理员

加入社区

获取链接或二维码

近7日

近30日

至今

加载中

查看更多榜单

社区公告

暂无公告 试试用AI创作助手写篇文章吧

+ 用AI写文章

相关尊享内容

各大直播平台至尊守护多少钱?一文带你了解
365bet亚洲官方网址

各大直播平台至尊守护多少钱?一文带你了解

📅 07-23 👑 21
英雄联盟王者几天不打会掉分
365bet开户网

英雄联盟王者几天不打会掉分

📅 06-28 👑 556