Click here to Skip to main content
15,899,679 members
Home / Discussions / C#
   

C#

 
AnswerRe: Hi All, Pin
Not Active23-Jun-06 2:23
mentorNot Active23-Jun-06 2:23 
QuestionAdd CSharp User Control To CDialogBar in VC++ Pin
scorpion_pgm8222-Jun-06 22:48
scorpion_pgm8222-Jun-06 22:48 
QuestionHow to get assembly version for a remote type? Pin
mav.northwind22-Jun-06 22:13
mav.northwind22-Jun-06 22:13 
AnswerRe: How to get assembly version for a remote type? Pin
leppie22-Jun-06 23:07
leppie22-Jun-06 23:07 
GeneralRe: How to get assembly version for a remote type? Pin
mav.northwind23-Jun-06 0:17
mav.northwind23-Jun-06 0:17 
GeneralRe: How to get assembly version for a remote type? Pin
Not Active23-Jun-06 3:47
mentorNot Active23-Jun-06 3:47 
GeneralRe: How to get assembly version for a remote type? Pin
mav.northwind23-Jun-06 6:21
mav.northwind23-Jun-06 6:21 
QuestionC# WMI Connection Pin
Shaps22-Jun-06 21:55
Shaps22-Jun-06 21:55 
Hello everybody,

I have a problem while trying to make a monitoring server with WMI. I have arround 400 check to do on 15 servers. After 5 minutes a lot of port on my server are un TIME_WAIT state, so I get a RCP-server not avalaible Frown | :( I've reduce the TIME_WAIT timeout but nothing change...

Is there a way to close the WMI connection, I'm using ManagementScope... Here's a part of my code

<br />
public WMIRequest(string Username, string Password, string IP)<br />
{<br />
	<br />
	aConnectionOptions = new ConnectionOptions();<br />
	aConnectionOptions.EnablePrivileges = true;<br />
	aConnectionOptions.Username = Username;<br />
	aConnectionOptions.Password = Password;<br />
	//aConnectionOptions.Timeout = new TimeSpan(0,0,30);<br />
	this.IP = IP;<br />
}<br />
public bool Connect()<br />
{<br />
	aManagementScope = new ManagementScope(@"\\"+ IP + @"\root\cimv2", aConnectionOptions);<br />
	aManagementScope.Connect();<br />
	return aManagementScope.IsConnected;<br />
}<br />
<br />
public string Request(string Request)<br />
{<br />
	aObjectQuery = new ObjectQuery(Request);<br />
	aManagementObjectSearcher = new ManagementObjectSearcher(aManagementScope, aObjectQuery);<br />
	aManagementObjectCollection = aManagementObjectSearcher.Get();<br />
	string Result = "";<br />
<br />
	foreach(ManagementObject aManagementObject in aManagementObjectCollection ) <br />
	{<br />
		if(aManagementObjectCollection.Count > 1)<br />
			Result += "|#*#|";<br />
<br />
		foreach (System.Management.PropertyData aPropertyData in aManagementObject.Properties)<br />
		{<br />
			if(aManagementObject.Properties.Count > 1)<br />
				Result += "|#|";<br />
			Result += aPropertyData.Name + "|*|"  + System.Convert.ToString(aManagementObject[aPropertyData.Name]);<br />
		}<br />
	}<br />
	return Result;<br />
}<br />


I hope somebody has already resolved this problem...

Thank you

Nicolas.
AnswerRe: C# WMI Connection Pin
Mattias Olgerfelt7-Mar-07 1:24
Mattias Olgerfelt7-Mar-07 1:24 
QuestionPaint Event Handler [modified] Pin
printscreen1234522-Jun-06 21:38
printscreen1234522-Jun-06 21:38 
QuestionTreeView visible Pin
ytubis22-Jun-06 21:12
ytubis22-Jun-06 21:12 
QuestionDataGridView Problem? [modified] Pin
Jax_qqq22-Jun-06 19:53
Jax_qqq22-Jun-06 19:53 
QuestionHtml reset button is called when esc button is clicked. how can i avoid it? Pin
nachisaravanan22-Jun-06 18:49
nachisaravanan22-Jun-06 18:49 
AnswerRe: Html reset button is called when esc button is clicked. how can i avoid it? Pin
Vasudevan Deepak Kumar22-Jun-06 20:43
Vasudevan Deepak Kumar22-Jun-06 20:43 
QuestionWhat is "this" Pin
urbane.tiger22-Jun-06 17:01
urbane.tiger22-Jun-06 17:01 
AnswerRe: What is "this" Pin
Esmo200022-Jun-06 17:18
Esmo200022-Jun-06 17:18 
GeneralRe: What is "this" Pin
urbane.tiger22-Jun-06 18:17
urbane.tiger22-Jun-06 18:17 
GeneralRe: What is "this" Pin
Robert Rohde22-Jun-06 20:33
Robert Rohde22-Jun-06 20:33 
GeneralRe: What is "this" Pin
urbane.tiger22-Jun-06 22:01
urbane.tiger22-Jun-06 22:01 
AnswerRe: What is "this" Pin
BoneSoft23-Jun-06 5:37
BoneSoft23-Jun-06 5:37 
QuestionSerialization from c++ to C# Pin
Esmo200022-Jun-06 16:48
Esmo200022-Jun-06 16:48 
QuestionTouch Screen Development Pin
oskardiazdeleon22-Jun-06 16:18
oskardiazdeleon22-Jun-06 16:18 
AnswerRe: Touch Screen Development Pin
Robert Rohde22-Jun-06 20:41
Robert Rohde22-Jun-06 20:41 
GeneralRe: Touch Screen Development Pin
oskardiazdeleon22-Jun-06 21:43
oskardiazdeleon22-Jun-06 21:43 
GeneralRe: Touch Screen Development Pin
Robert Rohde22-Jun-06 23:14
Robert Rohde22-Jun-06 23:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.