|
Try this code snippet.
try
{
System.Net.Dns.GetHostByAddress(this.serverAddress);
}
catch (System.Net.Sockets.SocketException)
{
}
www.troschuetz.de
|
|
|
|
|
Stefan,
Thanks but I think this will only be OK if there is a domain name server to provide a name. This system needs to work on LANs where there may not be one.
I guess I'll need to use the asynch StartConnect() method but I need a decent sample to see how to use it.
|
|
|
|
|
I don't think so.
The MSDDN doesn't state that you need the presence of a real DNS in your Network and i successfully used this method in my local LAN to determine whether a PC can be reached or not.
www.troschuetz.de
|
|
|
|
|
hi dear
i want to write 8puzzle problem with A* algoritme with manhatan heuristic but i got a magic problem thet when i assign a array of one node to local array and when i change the value of local array the array of node change too(source like this c=currnode.a)
what can i do;
|
|
|
|
|
It is happening because only reference of local array is copied to the node. try using Clone method of Array that makes a shallow copy of the data in an array. It returns an object, cast it to appropriate array and use it where-ever you want.
Maqsood Ahmed
Kolachi Advanced Technologies
http://www.kolachi.net/web/
|
|
|
|
|
no i said that array of node copy to local array and this problem appeared
sh not as shark ,as c#
|
|
|
|
|
Hi all,
Will the System.threading.Timer class stop or suspend when the PC is in sleep mode or suspend ? Are there any differences for Win98, Win2000 and WinXP ?
Thanks
|
|
|
|
|
As far as I know when the system is put to sleep or suspended there is nothing running at all. This means that your timers will be sleeping also.
Or did I misunderstand your question?
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Thanks for your advice.
But how can i keep the timer thread running even it is suspend or stopped, just like the system clock ?
|
|
|
|
|
The system time depends on a hardware component that is built into the motherboard. As you know it works even when the computer is off (even unplugged).
However you cannot run anything when the computer is off. If you are tracking elapsed time you should record the starting and ending times and take the difference.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
You can't. That's what "Suspend" means: everything is stoppped.
|
|
|
|
|
The you save the timestamp on a regular basis (say every 15 seconds) and use that when the sustem is un-suspended. That's as close as you can come. If the OS is suspended, message loops are not executed and there is no way (even using hardware interups) to run anything.
|
|
|
|
|
Does anyone know how to retrieve the return value of a SQL2000 stored procedure in C#? I'm using OleDbConnection, OleDbDataReader. The stored proc returns an integer value, and I can't seem to be able to retrieve it. I have named a parameter "retval", Direction = ParameterDirection.ReturnValue, type is SqlDbType.Int.
Any suggestions?
John K
|
|
|
|
|
The parameter with the Direction property set to ParameterDirection.ReturnValue will be set to the value returned by the stored procedure after the command is executed.
OleDbCommand command = new OleDbCommand(sql, connection);
OleDbParameter retval = command.Parameters.Add("ReturnValue", OleDbType.Integer);
retval.Direction = ParameterDirection.ReturnValue;
command.ExecuteNonQuery();
int returnValue = (int)retval.Value;
Charlie
if(!curlies){ return; }
|
|
|
|
|
were would i find them or how would i play the note 'a' from the computer are there pre-recorded things, how would i do this?
IM PROUD TO BE A GMAIL;
|
|
|
|
|
It seems like your second or third time asking this question and you still didn't get an answer. I did a 10 second google search and found the perfect solution for you:
http://www.codeproject.com/cs/media/MIDIToolkit.asp[^]
What you want to do is play notes. In Windows the easiest way to do this is MIDI. The above link seems like a highly rated MIDI toolkit. I hope you figure it out
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Hi,
I want to receive mail from my mailserver in c#. Could any one pls help with code.
Thanks,
Jr
jr
|
|
|
|
|
|
Hi there,
I'm trying to find a free NET excel spreadsheet style grid control that works well. Any ideas anyone...It has too be very easy, fast and comfortable to use, specially intended for input of a huge amount of data: easy navigation, extended copy and paste, row/colum reordering, dynamic row and column insert, etc.
Any help appreciated. The closest thing to what I need is a DataGrid MFC control posted in this web:
<url>http://www.codeproject.com/miscctrl/gridctrl.asp
...but I need it to be in Managed code if posible. Dont need source code, .dll would be enough.
P.D. dont need any incorporated databinding, will manage that myself.
|
|
|
|
|
|
|
Its not possible to insert negative sign into double textbox. Maybe anybody knows how to correct double textbox
control ?
|
|
|
|
|
Hello all
Thanks for your help
i check a some thing with if conditian i need it true check another condtion but if false cancel all the next steps
Regards
hay
|
|
|
|
|
Beginner question obviously.
if (<condition>)
{
}
else
{
}
If you need more help please be more specific.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
If it helps you you can use the following block:
bool success = false;
do {
success = DoWork1();
if (!success)
break;
success = DoWork2();
if (!success)
break;
...
success = true;
}while(false);
if (!success)
{
}
The do{...}while(false); is a clean way not to use a goto statement.
Another way is write something like:
bool success = true;
success = success && DoWork1();
success = success && DoWork2();
if (!success)
{
}
Regards,
Ami
|
|
|
|