C#写的c/s程序,怎样使用相对路径 rt谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string path=System.Windows.Forms.Application.StartupPath //path为你的C/S程序启动路径,你可以在此路径基础上调用或设置相对路径谢谢. Application.StartupPath是exe执行的路径,你可以使用这个路径为基础,访问该目录下的子目录。 string str = Assembly.GetExecutingAssembly().GetName().CodeBase; if (str.ToLower().IndexOf("file:///") >= 0) { str = str.Substring(8, str.Length - 8); } string path = System.IO.Path.GetDirectoryName(str);或Application.StartupPath Application.StartupPath Application.StartupPath+ ""; 10种方法可获取http://www.qimao.cn/article.asp?id=179 c#加密xml问题,求解答 代码重构 .net用户控件 请教c#高手,常规软件编辑功能的实现问题 请问 internal 和动态链接库的问题 我想学C#,能介绍几本好书吗? 高分求助查询ACCESS数据库的问题 初学ASP.NET,应该从哪儿学起? 我想获得局域网上所有的打印机,并显示在界面上怎么做? 菜鸟求教c++与c# 有关doc文档转化的问题 求算法
if (str.ToLower().IndexOf("file:///") >= 0)
{
str = str.Substring(8, str.Length - 8);
}
string path = System.IO.Path.GetDirectoryName(str);
或
Application.StartupPath