-1

I've GridView and in each row I've PING button, which ping IP adress of selected row. I can ping without problem when the project is run from Visual Studio, but when I run it like a client (SERVER IIS) it don't works ( Here is my code:

protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "PingButton")
        {
            // Retrieve the row index stored in the 
            // CommandArgument property.
            int index = Convert.ToInt32(e.CommandArgument);
            // Retrieve the row that contains the button 
            // from the Rows collection.
            GridViewRow row = GridView1.Rows[index];
            string ip = row.Cells[4].Text;
            System.Diagnostics.Process.Start("cmd.exe", "/k ping -t " + ip);
        }
    }
nuroraf
  • 11
  • Runtime module of visual studio is necessary on the system when you execute GridView program without Visual Studio. – Fumu 7 Sep 05 '14 at 06:03

1 Answers1

1

ASP.NET Web page and server control code executes in the context of the ASP.NET worker process on the Web server. If you use the Start method in an ASP.NET Web page or server control, the new process executes on the Web server with restricted permissions. The process does not start in the same context as the client browser, and does not have access to the user desktop. http://msdn.microsoft.com/en-us/library/0w4h05yb.aspx

Edi G.
  • 2,432
  • 7
  • 24
  • 33