/
通常我们WinForm编程时,要获取程序当 前运行的文件夹路径会用Application.StartupPath ,但是Application.StartupPath在编写类库项目时却无法 使用,因为我们根本无法用using System.Windows.Forms;来引入Application.StartupPath 的命名空间,这个时侯我们要用AppDomain.CurrentDomain.BaseDirectory。
private static string fullPathFileName = Application.StartupPath + "//Set.Ini "; //用于WINFORM
private static string fullPathFileName = AppDomain.CurrentDomain.BaseDirectory+"//Set.Ini"; //用于类项目
本文发布于:2024-02-03 07:20:05,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170691600549493.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |