获取PC上的绝对路径
string appPath = Application.StartupPath;//获取路径
INIFile ini = new INIFile(appPath + @"\config.ini");
获取移动设备开发中的绝对路径
string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);//获取路径
INIFile ini = new INIFile(appPath + @"\config.ini");
获取应用绝对路径方法
本文介绍了如何在PC和移动设备上获取应用程序的绝对路径。在PC上可通过Application.StartupPath直接获取,而在移动设备上则需使用System.IO和System.Reflection命名空间下的方法。这两种方法为配置文件等资源的定位提供了便利。
1万+

被折叠的 条评论
为什么被折叠?



