相对路径可以用System.IO.Directory.GetCurrentDirectory()获得当前应用目录的路径
也可尝试Application.StartupPath或者Application.ExecutablePath.
进度条你可以看msdn,这个控件很简单的,看看就会了,例子msdn上也有。

解决方案 »

  1.   

    CurDir()函数也可以返回相对路径,不过不是固定的。
      

  2.   

    Application.StartupPath//运行程序的路径Environment.CurrentDirectory //当前路径
    Application.StartupPath + "\file.ini"
      

  3.   

    进度条示例:
    private void CopyWithProgress(string[] filenames)
    {
        // Display the ProgressBar control.
        pBar1.Visible = true;
        // Set Minimum to 1 to represent the first file being copied.
        pBar1.Minimum = 1;
        // Set Maximum to the total number of files to copy.
        pBar1.Maximum = filenames.Length;
        // Set the initial value of the ProgressBar.
        pBar1.Value = 1;
        // Set the Step property to a value of 1 to represent each file being copied.
        pBar1.Step = 1;
        
        // Loop through all files to copy.
        for (int x = 1; x <= filenames.Length; x++)
        {
            // Copy the file and increment the ProgressBar if successful.
            if(CopyFile(filenames[x-1]) == true)
            {
                // Perform the increment on the ProgressBar.
                pBar1.PerformStep();
            }
        }
    }
      

  4.   

    如何复制整个文件下的所有文件到指定目录,并用进度条显示copy完成的%呢