1

我想用视频文件运行 VLC。

我在 VS 中编写了以下代码并在 IIS Express 下运行它。在 IIS Express 下一切都很好,我可以看到视频和音频。

但是当我将它发布到本地 IIS 时,我可以在任务管理器中看到 VLC.exe 并且能够听到音频但看不到 VLC 播放器。

代码片段

        public bool LaunchVlC(string choice)
        {
          System.Diagnostics.Process VLC = new System.Diagnostics.Process();
          VLC.StartInfo.FileName = @"F:\VLC\vlc.exe";
          VLC.StartInfo.Arguments = "-vvv " + choice;
          VLC.Start();
          return true;
        }

我已经在本地系统帐户下运行了 IIS Admin Service,并允许服务与桌面交互。还是看不到视频。

4

1 回答 1

1

As already indicated by 'Lex Li' in the comment section, if processes(your application in local IIS) running in session 0 request for the UI, the UI is not displayed in the user session. From the user perspective, the application appears to be hung, when in actual fact it is performing quite normally, and patiently waiting for a user response that the user cannot see!

In Windows Vista and above, Session 0 is created for services and user-mode drivers. Session 1 is created for the first user who logs in. Applications for this user run in Session 1.

Consider the following example – if a service belonging to an application generates a UI element in Session 0 – for example a dialog box waiting for the user to click “OK” or “Cancel”, the application is now waiting on the service, and the UI is not displayed in the user session. From the user perspective, the application appears to be hung, when in actual fact it is performing quite normally, and patiently waiting for a user response that the user cannot see!

As you can imagine – this presents a problem for users, administrators and developers. However, there are some quick mitigating factors to consider.

  1. If the application’s service uses a UI, a built-in mitigation (in Windows Vista and above) allows the user to interact with the Session 0 UI in a special desktop. This will make the UI specific to the application available and not the entire Session 0 desktop.

  2. If the application creates globally named objects, then use the Windows XP compatibility mode to ensure that the application will continue to work with the Session 0 services.

When testing applications for compatibility with Windows Vista and above, consider the following test scenarios:

  1. Test and verify the application on Windows XP in a Terminal Server mode or a Fast User Switching (FUS) mode. If the application works properly on Windows XP in these scenarios, then it is very likely to work under Windows Vista.

  2. Verify that the application functions properly after applying the Window XP compatibility mode, which contains mitigation for some of the Session 0 issues.

  3. Test the driver (in Windows Vista and above) to ensure that it runs properly. If that is not possible, test the driver in Windows XP with FUS enabled and multiple users logged on. If the driver works correctly for second and subsequent logged-on users, it is not likely to be affected by the Session 0 changes (in Windows Vista and above). The only issues that this test does not detect are those related to the absence of the video driver in Session 0 (in Windows Vista and above).

Finally, you can leverage the following Windows Vista and above capability solutions:

  1. Use client or server mechanisms such as remote procedure call (RPC) or named pipes to communicate between services and applications.

  2. Use the WTSSendMessage function to create a simple message box on the user’s desktop. This allows the service to give the user a notification and request a simple response.

  3. For more complex UI, use the CreateProcessAsUser function to create a process in the user’s session.

  4. Explicitly choose either the Local\ or Global\ namespace for any named objects, such as events or mapped memory, which the service makes available.

And that will do it for a quick look at how Session 0 isolation affects Application Compatibility in Windows Vista and above.


NOTE : Copied from Application Compatibility – Session 0 Isolation; check this link for more information.

于 2016-08-21T07:08:48.367 回答