载入文件并且获取路径

我把程序所需的配置信息写到了xml文件里。然后我右键打开该文件,但是无法获取该文件的文件路径,于是在各个论坛上问啊,网上搜资料啊,终于找到了,现分享之
 [STAThread]
        static void Main(string[] args)
        {
            MessageBox.Show(args[0]);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }

转载于:https://my.oschina.net/dongri/blog/610926

猜你喜欢

转载自blog.csdn.net/weixin_34315665/article/details/91765854