如何从 C# 显示文件属性对话框安全选项卡

Far*_*ukh 4 .net c# windows

这篇文章:如何从 C# 显示文件的属性对话框?描述了如何显示文件的属性对话框,我想知道是否可以使用相同的方法但将打开的选项卡设置为安全?来自 C# 代码。

见下图。

文件夹属性安全选项卡

先感谢您。

Beh*_*zad 5

添加info.lpParameters = "Security";以显示安全选项卡。

info.lpParameters = "Details";显示详细信息选项卡。

现在 ShowFileProperties 方法是:

    public static bool ShowFileProperties(string Filename)
    {
        SHELLEXECUTEINFO info = new SHELLEXECUTEINFO();
        info.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(info);
        info.lpVerb = "properties";
        info.lpFile = Filename;
        info.lpParameters = "Security";
        info.nShow = SW_SHOW;
        info.fMask = SEE_MASK_INVOKEIDLIST;
        return ShellExecuteEx(ref info);
    }
Run Code Online (Sandbox Code Playgroud)

参考:显示文件的属性页面并导航到选项卡