How do I display a file's Properties dialog from C#?

前端 未结 4 2112
无人共我
无人共我 2020-11-28 07:58

how to open an file\'s Properties dialog by a button

private void button_Click(object sender, EventArgs e)
{
    string path = @\"C:\\Users\\test\\Documents         


        
4条回答
  •  猫巷女王i
    2020-11-28 08:43

    Call Process.Start, passing a ProcessStartInfo containing the name of the file, and with the ProcessStartInfo.Verb set to properties. (For more info, see the description of the unmanaged SHELLEXECUTEINFO structure, which is what ProcessStartInfo wraps, and in particular the lpVerb member.)

提交回复
热议问题