0
can u do some staff buddy Thank you !
0
As u know srikant what i want buudy try to complete code .
0
ya offcourse has u mention code i write app.config file but i will access all at time i will used forach to read app settings now so can u please help to write code please i didn't understand what should i do.as u say iterate in for loop how? please do stuff srikant thankyou..i like ur way u helpn me..
0
If you want all the remote machine's information, then get the username, password from app.config and store in collection. And iternate over this list in your logic.
in c# code:
string remoteServer1= ConfigurationSettings.AppSettings["remoteServer1"];
string remoteServer1UserName= ConfigurationSettings.AppSettings["remoteServer1UserName"];
string remoteServer1UserPassword= ConfigurationSettings.AppSettings["remoteServer1UserPassword"];
0
its my actaully code getting only single remote server information now i trying multiple which was i store some remote server username and passwrd in my app.config file.so please now let me know how i do
0
In your code you are getting information from local machine. However with the below code you will get information from remote machine. Provide remote machine name in the "srvname".
Refer this article, which will give you idea to pass remote machine name and password.
https://msdn.microsoft.com/en-us/library/mt703458(v=vs.85).aspx
0
bro read my question again i didn't want single server information ..i already done this issue what u share here Now my focus is getting number of remote server information?
thank you for answering srikant
0
Try using ManagementScope.
- var srvname=""serverName"
- ConnectionOptions conn = new ConnectionOptions();
- string strNameSpace = @"\\";
- if (srvname != "")
- strNameSpace += srvname;
- else
- strNameSpace += ".";
- strNameSpace += @"\root\cimv2";
- System.Management.ManagementScope managementScope = new System.Management.ManagementScope(strNameSpace, conn);
- System.Management.ObjectQuery query = new System.Management.ObjectQuery("select * from Win32_LogicalDisk");
- ManagementObjectSearcher searcher = new ManagementObjectSearcher(managementScope, query);
https://msdn.microsoft.com/en-us/library/mt703458(v=vs.85).aspx