views:

37

answers:

2

I have the following code:

protected void VLC_Click(object sender, EventArgs e)
{
    SecureString password = ConvertStringToSecureString("[password]");

    string domain = "";
    Process.Start(@"C:\Program Files\VideoLAN\VLC\vlc.exe ", "[username]", password, domain);
}

private SecureString ConvertStringToSecureString(string s)
{
    SecureString secString = new SecureString();

    foreach (char c in s.ToCharArray())
    {
        secString.AppendChar(c);
    }
    return secString;
}

linked to a button on an aspx page running on IIS on my Vista machine. When I click the button in the browser, I can see the process start in task manager but shortly after the process terminates and no vlc window appears at any point.

Is there any way to have the button trigger vlc just as if I was clicking on the .exe in Windows?

+1  A: 

I hope you don't expect VLC appearing on the client machine when you do a Process.Start on the server in an ASP.NET application.

Darin Dimitrov
I want it to appear on the server.
Chris
Well, then you've managed it. It appeared. It executed under the account used to execute your ASP.NET site and that's all. What else do you expect? Probably this account doesn't have any permissions nor an associated GUI interface so you cannot expect showing anything on the server either.
Darin Dimitrov
I'd like the VLC process to appear with its normal window and the process to remain active. The user account is my normal login, to which I am logged onto the server at the time.
Chris
A: 

It should work if the user that runs asp.net is able to interact with the desktop. On windows services there is a setting one can check for this.

Marcus