0

I have a tool on server that keep reading data from some data source. Sometimes I want to open a asp.net page on a browser on a specific IP.

In other words: I have a server that is connected (on LAN network) to many computers.

Is it possible/applicable to open a asp.net page on a specific IP?

I already know the IP. and I am using this code to open the page

System.Diagnostics.Process.Start(popupURL + "?CallerID=" + callerID);

it is working on the server, but how can I tell the server to open the page on a specific IP?

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325
Marco Dinatsoli
  • 10,322
  • 37
  • 139
  • 253
  • what do you mean? what have you tried? – Hamid Pourjam Mar 01 '15 at 09:34
  • @dotctor i don't know what should I try. I mean to let the server opens the browser on a computer connected to it. got me please? – Marco Dinatsoli Mar 01 '15 at 09:37
  • @dotctor could you tell me about what should I search to solve the problem? i have been searching but nothing found – Marco Dinatsoli Mar 01 '15 at 10:02
  • 1
    if you want to do a computer to do something from another computer, you should make a program that receives commands and do work for you. run this program on clients, connect to server, send command from server to the client and client will do the work. this is not easy. what do you want to do exactly? – Hamid Pourjam Mar 01 '15 at 10:10
  • @dotctor I have a server, and on the server there is a tool that keeps watching/analysing data from many data sourcces, sometimes the result of the analysis is not good. Thus, I want to inform the agent (who is a person works on a computer connected locally to the server using LAN network). Thus, I want to open a page on **his** computer . do you get me? if that is not possible, I will make that tool works on every agent's computer and do an extra check which is: if the result is for **this** agent, open the page, otherwise, ignore it. got me please? – Marco Dinatsoli Mar 01 '15 at 10:15
  • @Marco Dinatsoli can you tell us the importance of using a asp.page in this scenario? are you trying to capture any user action in the asp page or is it just a notification? – user3240361 Mar 11 '15 at 07:24

1 Answers1

3

I want to open a asp.net page on a browser on a specific IP.

That is not possible just for any PC, but you can if the PC is controlled by a domain controller, which is very likely in a business environment. You can use WMI as explained in this answer. I altered the code to comply with your needs:

string theProcessToRun = "http://url_to_open";
string ipAddress = "0.0.0.0";

string remoteIdentifier = string.Format(@"\\{0}\root\cimv2:Win32_Process", ipAddress);
ManagementClass mc= new ManagementClass(remoteIdentifier);

mc.InvokeMethod("Create", new [] { theProcessToRun });
Community
  • 1
  • 1
Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325
  • do you mean that i should deploy my page on **the server** and use your code **in the server** too? – Marco Dinatsoli Mar 04 '15 at 08:35
  • Yes, you should have the appropriate domain administration privileges when running, but besides that, you are all set. – Patrick Hofman Mar 04 '15 at 08:36
  • what is the value or remoteIdentifier? in my case what should it be please? I understood that the `theProcessToRun` variable should have the URL of the page that is deployed on the server and which I want to open in the agent's computer. but what is the `remoteIdentifier` varaible for? – Marco Dinatsoli Mar 04 '15 at 09:01
  • @MarcoDinatsoli: Just fill the field `ipAddress`. Nothing else to change about it. The `remoteIdentifier` is some code for WMI to know what to do. – Patrick Hofman Mar 04 '15 at 09:02
  • okay I did, do you know what DLL should I add in order to be able to include `MannagementClass` ? – Marco Dinatsoli Mar 04 '15 at 09:04
  • not just the `ipAddress`, I have to change the `thePrcoessToRun` value, right? – Marco Dinatsoli Mar 04 '15 at 09:05
  • @MarcoDinatsoli: Yes, that was regarding the `remoteIdentifier`. – Patrick Hofman Mar 04 '15 at 09:05
  • @MarcoDinatsoli: You can find it in [`System.Management`](https://msdn.microsoft.com/en-us/library/system.management.managementclass%28v=vs.110%29.aspx). – Patrick Hofman Mar 04 '15 at 09:05
  • after adding the `System.Management` to the project. However, now Visual studio complains about `mc.InvokeMethod("Create", theProcessToRun);` the arguments are not correct. – Marco Dinatsoli Mar 04 '15 at 09:09
  • Thank you for updating the answer, i need sometime to test that and I will come back to u – Marco Dinatsoli Mar 04 '15 at 10:15