|
|
How can I get the local machine's IP address in a Windows app ?
|
|
|
|
|
|
Did you even try Google before posting this..?
|
|
|
|
|
System.Net.IPAddress[] MyIPs = System.Net.Dns.GetHostAddresses(Environment.MachineName);
Harvey Saayman - South Africa
Software Developer
.Net, C#, SQL
you.suck = (you.Occupation == jobTitles.Programmer && you.Passion != Programming)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
Hi,
All previous replies lead to your local IP address, i.e. the address as seen on your LAN; when connecting to the Internet, the outside world may see you at a different address though, and you need an external server to tell you that address, have a look here[^].
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
//
//IP
//
System.Net.IPAddress[] addressList = Dns.GetHostByName (Dns.GetHostName()).AddressList;
for (int i = 0; i < addressList.Length; i ++)
{
s += addressList[i].ToString();
}
modified 27-May-14 5:31am.
|
|
|
|
|
Hi guys
So the past few weeks I've been doing research and playing around with TCP servers. I've finally got the one type of server architecture down and I understand the why's and the how's.
Basically the server object creates a TcpListener in its own thread to listen for client connections. When this listener thread accepts a client it creates a client object for it and handles communication(which is the blocking type) for that client in its own thread. So 1 thread per client.
I get that this doesn't scale well and why.
Now I need to move on to the non blocking way. I believe its called "asynchronous TCP sockets", using BeginConnect() , BeginAccept() , BeginSend() , BeginReceive() , EndConnect() , EndAccept() , EndSend() and EndReceive()
Now I've found alot of articles but what I really need is a bare bones example and explanation. Alot of these articles are built around custom libraries and implementations of this server architecture and I find it difficult to find the core concepts in between other code.
So my question, can anyone recommend an article where this is explained well enough and in a bare bones type manor? I'm really more interested in how it works instead of copying the code and modifying it for my needs.
Thanks
Harvey Saayman - South Africa
Software Developer
.Net, C#, SQL
you.suck = (you.Occupation == jobTitles.Programmer && you.Passion != Programming)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
Harvey Saayman wrote: Basically the server object creates a TcpListener in its own thread to listen for client connections
When creating scalable server applications, you should work directly with Socket class. If you need more, come up with a custom socket implementation which suits your needs. We did this once with an application. TcpListener or TcpClient are just wrapper classes built on top of Socket class. You will find it very limiting when you start coding with these classes.
Here[^] is my favorite article. I never found another one which is not even closer to this.
If you are doing serious coding, I would suggest to take a book rather than depending on several articles.
|
|
|
|
|
Hey Navaneeth
That looks promising thank you very much
<NoteToOthers>
If you know of other useful articles please let me know
</NoteToOthers>
Harvey Saayman - South Africa
Software Developer
.Net, C#, SQL
you.suck = (you.Occupation == jobTitles.Programmer && you.Passion != Programming)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
hi all,
i hav a css class which i hav applied to 4 elements. i want to change the width property od the css class alone in code behind.
how do i do it?
thanks in advance
|
|
|
|
|
there is no way to change a single attribute in a css class in code behind.
how u can do it is either giv another css class or set a particular style attribute in code behind
|
|
|
|
|
// asp.net
<td class="UI" ...>
//css
.UI
{
。。。
。。。
width:100%; /* width:50px*/
。。。
。。。
}
modified 27-May-14 5:31am.
|
|
|
|
|
i have created a dynamic 2d array using list<list <double="">> ....
now i want to convert this object into an actual array ?
how can i do that ?
bcoz the list.toarray can (i think convert it into a 1d array)???
|
|
|
|
|
Couple of things:
1) When you try to describe things such as List<T> please use the greater than and less than symbols just above - that way they don't get stripped out as HTML.
2) We would need more information. I am guessing that your "dynamic 2D array using list>" is actually along the lines of "List<List<string>>" but it could be anything really. We need to know what you are doing in order to help.
3) Check your post with the "Preview" button to ensure it looks like what you wrote! I keep forgetting...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
hi,
is there any site from where developer can acquire Domain knowledge for developing accounting software or CRM or various module of ERP. i search google but didn't find any such site so if anyone knows then please give me the reference of those site.
Thanks
tbhattacharjee
|
|
|
|
|
Hi
I was trying to use Application_Start method of Global.asax file to catch Exceptions. Can we add Global.asax to Window application. I am not able to add it. Can anyone help me on this.
Thanks & Regards
Inderjeet Kaur
Inderjeet Kaur
Sr. Software Engg
|
|
|
|
|
You can't use the Global.asax in a WinForm application AFAIK.
Maybe you should have a look at the System.Windows.Forms.Application.ThreadException event instead.
|
|
|
|
|
|
when you create a winForm project.
you will find a file called "program.cs";
you can write codes there
modified 27-May-14 5:31am.
|
|
|
|
|
Hi.
Three printers were installed on my system.
I gonna print a WebBrowser on a specific printer in a specific size !
Could you please guide me how I can do it ?
Thanks
|
|
|
|
|
Do you have a print button or menu selection in your browser?
|
|
|
|
|
you can use this function:
"WebBrowser.ShowPrintPreviewDialog()",
you can choose one printer here.
modified 27-May-14 5:31am.
|
|
|
|
|
Hi,
i want to display the list of websites that are using Google ad-sense for given list of key words
i am using c#.net and windows application
please tell which webservice i have to use to accomplish this task
Thanks
Anil Veeraghattapu.
|
|
|
|
|
Well, I can't imagine a time when it wouldn't be more appropriate to ask what google told you.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|