首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

C#文件路径的有关问题

2012-03-02 
C#文件路径的问题C:\DocumentsandSettings\chen\桌面\socket客户端\Custom.xml用相对路径怎么读取Custom.x

C#文件路径的问题
C:\Documents   and   Settings\chen\桌面\socket客户端\Custom.xml
用相对路径怎么读取Custom.xml信息?

[解决办法]
Server.Mappath( "Custom.xml ");
[解决办法]
winform的话用Application.StartupPath+文件夹/文件
web的话可以用HttpContext.Current.Request.PhysicalApplicationPath+文件夹/文件

热点排行