Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# .NET WPF Process.Start()在Vista和Windows 7上不工作_C#_.net_Wpf_Windows 7_Windows Vista - Fatal编程技术网

C# .NET WPF Process.Start()在Vista和Windows 7上不工作

C# .NET WPF Process.Start()在Vista和Windows 7上不工作,c#,.net,wpf,windows-7,windows-vista,C#,.net,Wpf,Windows 7,Windows Vista,我有WPF申请。 在Windows7上测试我的应用程序后,我意识到打开“帮助”不起作用 基本上要打开chm帮助文件,我调用: Process.Start("help.chm"); 什么也没发生。我也在Vista SP1上试用了我的应用程序,结果是一样的。 我是两个操作系统的管理员 我用谷歌搜索了这个问题,但还没有找到解决办法 有办法解决这个问题吗 您是否经历过这种类型的不兼容 谢谢大家! 这应该对你有帮助。此外,这里还有一个关于UAC和如何提升的问题。这应该会对您有所帮助。另外,这里有一个关于

我有WPF申请。 在Windows7上测试我的应用程序后,我意识到打开“帮助”不起作用

基本上要打开chm帮助文件,我调用:

Process.Start("help.chm");
什么也没发生。我也在Vista SP1上试用了我的应用程序,结果是一样的。 我是两个操作系统的管理员

我用谷歌搜索了这个问题,但还没有找到解决办法

有办法解决这个问题吗

您是否经历过这种类型的不兼容


谢谢大家!

这应该对你有帮助。此外,这里还有一个关于UAC和如何提升的问题。

这应该会对您有所帮助。另外,这里有一个关于UAC和如何提升的问题。

你试过ShellExecute吗

使用System.Runtime.InteropServices

[DllImportshell32.dll,CharSet=CharSet.Auto] 静态外部布尔ShellExecuteExref SHELLEXECUTEINFO lpExecInfo

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct SHELLEXECUTEINFO
{
    public int cbSize;
    public uint fMask;
    public IntPtr hwnd;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpVerb;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpFile;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpParameters;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpDirectory;
    public int nShow;
    public IntPtr hInstApp;
    public IntPtr lpIDList;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpClass;
    public IntPtr hkeyClass;
    public uint dwHotKey;
    public IntPtr hIcon;
    public IntPtr hProcess;
}
您可以尝试从以下内容开始此过程:

        SHELLEXECUTEINFO info = new SHELLEXECUTEINFO();
        info.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(info);
        info.lpVerb = "open";
        info.lpFile = "help.chm";
        info.nShow = 5;
        info.fMask = 12;

        ShellExecuteEx(ref info);

你试过ShellExecute吗

使用System.Runtime.InteropServices

[DllImportshell32.dll,CharSet=CharSet.Auto] 静态外部布尔ShellExecuteExref SHELLEXECUTEINFO lpExecInfo

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct SHELLEXECUTEINFO
{
    public int cbSize;
    public uint fMask;
    public IntPtr hwnd;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpVerb;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpFile;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpParameters;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpDirectory;
    public int nShow;
    public IntPtr hInstApp;
    public IntPtr lpIDList;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpClass;
    public IntPtr hkeyClass;
    public uint dwHotKey;
    public IntPtr hIcon;
    public IntPtr hProcess;
}
您可以尝试从以下内容开始此过程:

        SHELLEXECUTEINFO info = new SHELLEXECUTEINFO();
        info.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(info);
        info.lpVerb = "open";
        info.lpFile = "help.chm";
        info.nShow = 5;
        info.fMask = 12;

        ShellExecuteEx(ref info);

它只是.chm文件吗?如果是这样,它可能无法打开,因为默认情况下,不受信任位置的chm文件被阻止。请参阅:。从这一点来看,您可能能够通过编程方式解除对它们的阻止,即使只是按照本文中的引用首先启动Sysinternals streams.exe。

它只是.chm文件吗?如果是这样,它可能无法打开,因为默认情况下,不受信任位置的chm文件被阻止。请参阅:。从中可以看出,您可以通过编程方式解除对它们的阻止,即使只是如本文所述首先启动Sysinternals streams.exe。

pinvoking ShellExecute直接与调用ProcessStartProcess StartInfo(UseShellExecute=true)有什么区别?pinvoking ShellExecute直接与调用ProcessStartProcess StartInfo(使用UseShellExecute=true)有什么区别UseShellExecute=true?