Click here to Skip to main content
16,005,038 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to check selected node is parent or child ? Pin
quiteSmart13-Nov-06 0:31
quiteSmart13-Nov-06 0:31 
GeneralRe: how to check selected node is parent or child ? Pin
Exelioindia13-Nov-06 1:05
Exelioindia13-Nov-06 1:05 
GeneralRe: how to check selected node is parent or child ? Pin
quiteSmart13-Nov-06 1:19
quiteSmart13-Nov-06 1:19 
AnswerRe: how to check selected node is parent or child ? Pin
saqib8213-Nov-06 2:20
saqib8213-Nov-06 2:20 
QuestionUsing netscape.exe with www.yahoo.com Pin
M Riaz Bashir13-Nov-06 0:03
M Riaz Bashir13-Nov-06 0:03 
AnswerRe: Using netscape.exe with www.yahoo.com Pin
stancrm13-Nov-06 0:31
stancrm13-Nov-06 0:31 
AnswerRe: Using netscape.exe with www.yahoo.com Pin
quiteSmart13-Nov-06 0:33
quiteSmart13-Nov-06 0:33 
QuestionCompare object in C# Pin
FernandoCR13-Nov-06 0:00
FernandoCR13-Nov-06 0:00 
Hi,
I want to compare two objects. I make a object and get the services from my machine, after sometime I make another object and get the services form my machine. I compare the two and popup a messagebox with the result of the comparation. But always is "distint", and the services are the same.

How can I do this?

I have do a example what enclose.

example:

public partial class Form1 : Form
{
ServiceController[] scServicesA;
public ServiceController scTempB;
public ServiceController scTempA;
public Form1()
{
InitializeComponent();
scServicesA = ServiceController.GetServices();
int cuentaA = 0;
clbA.Items.Clear();
clbB.Items.Clear();
foreach (ServiceController scTempA in scServicesA)
{
cuentaA += 1;
clbA.Items.Add(scTempA.DisplayName + " (" + scTempA.ServiceName + ")" + "\r\n");
}
Timer tmr = new Timer();
tmr.Interval = 3000;
tmr.Enabled = true;
tmr.Tick += new EventHandler(tmr_tick);
lblCuentaA.Text = cuentaA.ToString();
}
public int cuentaB;
public void tmr_tick(object sender, EventArgs e)
{
clbB.Items.Clear(); //Borra lo que tenga.
cuentaB = 0;
ServiceController[] scServicesB;
scServicesB = ServiceController.GetServices();

foreach (ServiceController scTempB in scServicesB)
{
clbB.Items.Add(scTempB.DisplayName + " (" + scTempB.ServiceName + ")" + "\r\n");
cuentaB += 1; //incrementa el contador de servicios.
}
lblCuentaB.Text = cuentaB.ToString();

if (clbA.Equals(clbB)) MessageBox.Show("Son IGUALES");
else MessageBox.Show("Son DISTINTOS");
}
}


Thanks,
Fernando
AnswerRe: Compare object in C# Pin
Judah Gabriel Himango13-Nov-06 11:19
sponsorJudah Gabriel Himango13-Nov-06 11:19 
QuestionRe: Compare object in C# Pin
FernandoCR13-Nov-06 22:33
FernandoCR13-Nov-06 22:33 
AnswerRe: Compare object in C# Pin
Judah Gabriel Himango14-Nov-06 5:26
sponsorJudah Gabriel Himango14-Nov-06 5:26 
NewsRe: Compare object in C# Pin
FernandoCR14-Nov-06 6:27
FernandoCR14-Nov-06 6:27 
GeneralRe: Compare object in C# Pin
Judah Gabriel Himango14-Nov-06 16:05
sponsorJudah Gabriel Himango14-Nov-06 16:05 
QuestionCD Drive monitor Pin
Eduard Keilholz12-Nov-06 23:58
Eduard Keilholz12-Nov-06 23:58 
AnswerRe: CD Drive monitor Pin
Eduard Keilholz13-Nov-06 21:44
Eduard Keilholz13-Nov-06 21:44 
QuestionResoution Compatible Project Pin
freshonlineMax12-Nov-06 22:24
freshonlineMax12-Nov-06 22:24 
AnswerRe: Resoution Compatible Project Pin
Christian Graus12-Nov-06 23:13
protectorChristian Graus12-Nov-06 23:13 
GeneralRe: Resoution Compatible Project Pin
freshonlineMax14-Nov-06 3:09
freshonlineMax14-Nov-06 3:09 
QuestionValidation - Numeric and Special Characters Pin
Deepasubramanian12-Nov-06 21:51
Deepasubramanian12-Nov-06 21:51 
AnswerRe: Validation - Numeric and Special Characters Pin
freshonlineMax12-Nov-06 22:35
freshonlineMax12-Nov-06 22:35 
AnswerRe: Validation - Numeric and Special Characters Pin
stancrm12-Nov-06 22:37
stancrm12-Nov-06 22:37 
AnswerRe: Validation - Numeric and Special Characters Pin
Christian Graus12-Nov-06 23:15
protectorChristian Graus12-Nov-06 23:15 
QuestionI need to know Crystal Report Version Pin
M Riaz Bashir12-Nov-06 21:09
M Riaz Bashir12-Nov-06 21:09 
AnswerRe: I need to know Crystal Report Version Pin
spy7712-Nov-06 21:45
spy7712-Nov-06 21:45 
GeneralRe: I need to know Crystal Report Version Pin
M Riaz Bashir12-Nov-06 22:25
M Riaz Bashir12-Nov-06 22:25 

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.