|
How about showing some code or being a little more verbose?
It's almost impossible to help you if every single piece of information has to be wormed out of you...
If you're using a TcpClient for example, the call to Connect will throw an exception if the remote partner is not available, you can get a SocketException when writing to a NetworkStream with a disconnected remote partner, and so on. So what exactly are you doing and where do you need the information if the remote part is there?
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
i am using this thing to send a ping to the client system..fine so suppose the network cable is unplugged still the server is sending the ping ...now when the system shut downs unexpectedlly due to power then the message is not send a exception is coming ..my doubt is why this expection is not raised when network cable is unplugged
regards
sindhu tiwari
its me sid
|
|
|
|
|
Once again - without any code it's impossible to tell where you're going wrong!
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Take a look at the System.Net.NetworkInformation namespace.
It contains a class called NetworkChange which contains two events: NetworkAddressChanged tells you when an IP address has changed, and NetworkAvailabilityChanged tells you when any network's availability changes.
This, incidentally, is the same event Windows uses when it shows you the little notification balloon in the task tray when a cable is unplugged - they hook into the same operating system message.
That namespace contains a number of other extremely interesting and useful classes, so spend some time exploring it. You can do pretty much anything you need to with networks using that namespace.
It has become appallingly obvious that our technology has exceeded our humanity. - Albert Einstein
|
|
|
|
|
Thanks for ur reply...
The main thing is that i want to know the network details about the client so if u have any idea how to implement this then please let me know
its me sid
|
|
|
|
|
The NetworkInformation namespace contains a class that provides information about the connected networks, as well - IP address, network type, speed, etc.
It has become appallingly obvious that our technology has exceeded our humanity. - Albert Einstein
|
|
|
|
|
Hi There ,
I have an application that creates a csv file and I want it to display it in excel after creation.
I've used to following code - which works well :
using ExcelInterop = Microsoft.Office.Interop.Excel;<br />
<br />
ExcelInterop._Worksheet ExcelWorkSheet;
<br />
Microsoft.Office.Interop.Excel.Application excelApp = null;<br />
try<br />
{<br />
excelApp = new ExcelInterop.ApplicationClass();<br />
<br />
<br />
excelApp.Visible = true;<br />
<br />
string path = txtOutputPath.Text;
excelApp.Workbooks.Open(path, 0, false, 2, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindow s, "", true, false, 0, true, false, false);<br />
ExcelWorkSheet = (ExcelInterop._Worksheet)(excelApp.ActiveWorkbook. ActiveSheet);<br />
ExcelWorkSheet.Columns.AutoFit();<br />
ExcelWorkSheet.Columns.HorizontalAlignment = ExcelInterop.XlHAlign.xlHAlignLeft;
ExcelWorkSheet._DisplayRightToLeft = 0;
}<br />
catch (Exception ex)
{<br />
if (excelApp != null)<br />
excelApp.Quit();<br />
MessageBox.Show(ex.Message);<br />
}
(The code above is just a segment)
The thing is - my CSV file contains some fields with long numbers. I want this numbers to be displayed as text (WYSIWYG) - but Excel chagnes them - for eg. : 909490266168 -----> 9.0949E+11
I want to add something to my code that'll set the format of all cells to be "Text" (So everything will be displayed just as it is in the CSV file - not altering anything).
I tried : ExcelWorkSheet.Cells.NumberFormat = "Text" but this did not work properly and messed up some Date cells.
I'm not so familier with Excel Programming , So help will be appreciated. Thanks in advance.
|
|
|
|
|
I don't think that can be done with CSV, but the SYLK format can do it.
Plus, if you just want to display the data, try using Process.Start to tell the operating system to open the file.
|
|
|
|
|
Hi Friends ...
I m facing problem in adding tooltip to the dropdownlist. I've
written a message in design time but its not showing it in the runtime.
any code ...
Thanking you ....
|
|
|
|
|
i have a attendance time application everything is fine bt any user can come and login as the other one(with other id).
i want to restrict one user to enter as another user.. how to to tat?
jAgAdEeP.sUgGuLa
|
|
|
|
|
Member 4194906 wrote: user can come and login as the other one(with other id).
why not using password along with password !!!!
|
|
|
|
|
Use the user's Windows Principal rather than have them type in a username?
|
|
|
|
|
Hi All,
I have the following scenario.
"I have 3 lists and a treeView named list1, list2, list3 and tV1.list1 contains the TableNames, list2 contains ColumnNames and the list3 contain the ColNames that the user selects from the list2 by clicking the button named "Select".
[Problem].Now I want to do like this when the user clicks the button every time, the selectedItem of the list1 should become the root node and the contents of list3 should become as children of that root..keep in mind that previous data of tV1 should'nt be lost but only the updation is performed"
Regards,
chanzeb chaudhary
|
|
|
|
|
Hi...
using System.Net;
In the Main Program, I declared...
String strHostName = Dns.GetHostName();
IPAddress[] add1 = Dns.GetHostAddresses(strHostName); // <- set a breakpoint
Console.WriteLine("Local Machine: " + add1);
In the Locals Dialog box of Visual Studio 2005,
I found the value of add1[1] is {15.854.457.47} and type: System.Net.Address.
Have any idea to grab this IP Address?
Thanks.
|
|
|
|
|
What do you mean specifically by "grab it"?
You have it in a variable, what do you want to do with it?
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Grab it n display.
For example, Console.WriteLine( 'the IP Address' );
|
|
|
|
|
It looks too obvious, so I don't know if this is what you want:
Console.WriteLine("Local Machine: " + add1[1]);
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
|
Hello.
Im using smspdulib to decode PDU strings from my cell phone.
http://www.codeproject.com/KB/cs/smspdulib.aspx[^]
That works fine,but if a pdu string is longer(i guess longer than 160 chars) it doesnt work anymore.
Can this be done with smspdulib or some other way?
|
|
|
|
|
After this[^] it is with some trepidation that I ask my question
I need the advice of a guru. I have an exe and an assembly dll. The exe references the assembly and the assembly does not reference the exe. I want to keep that separation. What I want to do is that when a certain event happens in the assembly DLL I want something to happen in a form in the exe. I *could* reference the form in the dll but I don't think that is a "right" way to do it. I think that there is some other construct that would allow me to raise an event in the exe without binding the two together. My best guess at the moment is to create delegates.... somehow.
Anyone have a gentle nudge that will push me in the proper direction?
TIA
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
modified on Saturday, January 05, 2008 12:14:43 AM
|
|
|
|
|
Well - I'm a little confused. First you say:
Wes Aday wrote: when a certain event happens in the assembly DLL I want something to happen in a form in the exe.
and then you say
Wes Aday wrote: that would allow me to raise an event in the exe
So where is the event coming from? You see my confusion.
That's the key question to answer before we can be of any help...
It has become appallingly obvious that our technology has exceeded our humanity. - Albert Einstein
|
|
|
|
|
Patrick Sears wrote: So where is the event coming from
Sorry for the confusion.
Say that the dll is reading a database and then I want to notify the exe that the read is complete and the form should refresh the data it is displaying. (I know that I could bind a control to a datasource but just for the sake of arguement). Or, even the dll is monitoring a folder for new files or something.
I mean does it really matter what triggers the event? And, note that I am not looking for code. I want to figure the actual mechanics out but just need a hint of what I really should be doing in this circumstance.
In VC++ I could post a message to the exe and have an event handler to handle the message, for example. I just don't want the dll to be dependent on anything in the exe.
Thanks for responding
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Ok, this is simple enough. You need to decide what class in your DLL that you want to raise the event. Keep in mind that this can be a static class, with a static event.
Define the event in the DLL, and what in the DLL will raise it. In the exe, you simply attach an event handler to that event on that class.
Think of the exe as a 'consumer' of the DLL. The DLL has no idea who or what is consuming it.. it only knows that when you tell it to, it raises the event you specify.
It should be that simple.. or am I missing something?
It has become appallingly obvious that our technology has exceeded our humanity. - Albert Einstein
|
|
|
|
|
Patrick Sears wrote: It should be that simple
Yes you have the gist of it.
Patrick Sears wrote: The DLL has no idea who or what is consuming it
That is a good way to put it. I should have said that to begin with
Patrick Sears wrote: Define the event in the DLL, and what in the DLL will raise it. In the exe, you simply attach an event handler to that event on that class
Thanks! I just wanted some validation to the assumption that events are a semi-decent way to go. I guess I am off to study up on C# event routing.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Patrick Sears wrote: simple
OMG. I apologize for wasting your time. If I had only known that it was as seemingly simple as what I think it is....
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|