Chris
Chris

Reputation: 43

Start VLC from asp.net webpage

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?

Upvotes: 0

Views: 1102

Answers (2)

Marcus
Marcus

Reputation: 1876

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.

Upvotes: 0

Darin Dimitrov
Darin Dimitrov

Reputation: 1038710

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.

Upvotes: 1

Related Questions