zoukankan      html  css  js  c++  java
  • Xp中的相对路径

    前段时间写程序写相对路径时忘记加Application.StartupPath,出现了奇怪的错误,相对路径出现了不同的结果。

    实践检验了一下:原来在有打开文件对话框时,文件相对路径会等于 打开文件的磁盘+相对路径。

            string raletivepath = @"\hello.txt";
            private void button1_Click(object sender, EventArgs e)
            {
                if (openFileDialog1.ShowDialog() ==DialogResult.OK)
                {
                    
                }
    
                this.textBox1.Text = Path.GetFullPath(raletivepath);
    
            }

    得到的结果图片:


    第一次写博客,写得不好,请多见谅~

  • 相关阅读:
    hihocoder 1038
    hihocoder 1039
    poj 2774
    bzoj 4690&&4602
    poj 2417
    STL
    poj 1026
    poj 1064
    poj 1861(prim)
    poj 1129
  • 原文地址:https://www.cnblogs.com/desmond/p/2096672.html
Copyright © 2011-2022 走看看