|
I do not mean any control. I have to draw a table of 3 rows and 3 columns then i have to print image in every position of the table
|
|
|
|
|
Hi, this is my first post on CodeProject.
I searched for months how to do this, but I didn't find anything that works.
Well, I want to connect 2 computers. Just to say "hello world" and receive this.
I used sockets and it works. On LAN.
But I want to do this on WAN.
I heard about UPnP, NAT Transversal; but no one of the examples given works.
For example,
NAT Traversal with UPnP in C#[^] didn't work,
Neither Woodchop.Net.UPnP,
Neither NATUPnP 1.0 Type Library of Chris Pietschmann.
If I can connect these computers with another technology, please, let me know.
Thanks for reading
|
|
|
|
|
AFAIK you can use Web services for communication between two computers over internet.
|
|
|
|
|
In order to use a WebService, I want to host my application on a server.
But, I want to simple connect the computers, like on a instant messenger.
For example:
10.0.0.1 ----- 208.67.256.xx == 208.67.249.yy ----- 192.168.0.1
| |
10.0.0.5 192.168.0.127
What can I do to connect 10.0.0.5 with 192.168.0.127, using Sockets and another technology?
|
|
|
|
|
Does this[^] article helps?
|
|
|
|
|
Yes, this code works on a LAN connection.
But what should I do to connect computers over a WAN (Internet) connection?
Port forwarding would be an answer, but I couldn't do this in C#.
|
|
|
|
|
Hi, that first article would be mine, in what way doesn't it work? (can't fix what I don't know about )
|
|
|
|
|
Sure.
Well, when I use the UPnP.NAT.Discover() method,
the program stucks on the 44th line of the class:
length = s.Receive(buffer);
I don't know why.
Maybe, the UPnP feature on the router is disabled. (because I don't have access to it [ISP router])
But, if it is the problem, please tell me another way to forward ports..
Thanks.
|
|
|
|
|
Do you have µTorrent installed? It uses almost the same method of port forwarding as I do in that article (because, well, that's how I figured out how to do it..)
So that would be a simple way to test whether your router supports UPnP - enable the UPnP feature and look in the log for UPnP errors, if there are any then there's not much you can do, apart from switching ISPs I suppose..
There is an other way to forward ports called NAT-PMP but it's not used in practice.
|
|
|
|
|
In uTorrent I can download normally the torrents, but the site http://www.utorrent.com:16000/testport?port=37218[^] says that "An error has occurred!".
Do you have any idea what type of forward MSN Messenger uses?
I'll search about the "NAT-PMP" anyway, thank you.
|
|
|
|
|
Hm ok, I don't know what MSN does, but whatever it does it would only be needed for file transfer and voice/cam - normal messages are routed through MS (there goes your privacy..)
I'll look into it when I have more time to run tests
|
|
|
|
|
OK, thank you.
If I found anything, I'll post here.
|
|
|
|
|
Ok cool
Oh btw, have you looked at Mono.Nat? I didn't have too much luck with it, but several people have recommended it in the past and it's free anyway..
|
|
|
|
|
No, I haven't. Thanks, I'll give a look at this project!
|
|
|
|
|
First, sorry for my poor english
If u want connect two computer through internet for your application(using socket programming or wcf). U must open port of your modem.
Example: server application use port 8080 to listen client connect to. U must open port 8080.
To open port, run cmd, type ipconfig, enter. The default getway is Ip of modem. Type this IP on IE or FireFox... to access modem, (require usename and password). U cant find the way to open port modem here http://portforward.com/[^]
Client app can connect to your server app if it use correct global IP and port, u can use this page to know your global IP (dynamic IP) http://ip2location.com
Note: if u test your app, both client and server on a computer or computers on LAN, u cant use this global IP (instead LAN IP, or loopback IP). U can get your friend(certainly, use a computer connected internet) to help you.
IF ur app use wcf, u must set security mode in config file to "none" (this is the easiest way ).
|
|
|
|
|
But.. If I can't access the router/modem?
With this example, I can connect a computer to a gateway.
I want to gateway could redirect this connection to a sub-network computer.
I'll search more about WCF, I don't know what it is.
Thank you!
|
|
|
|
|
I want to add button like the following screen shot in my application with VC#. It's from Firefox with Glasser. Can anyone help?
Screenshot
|
|
|
|
|
|
|
|
Hi
Let's assume that I have 2 forms, the main form and the form that main form opens (Form2).
In the first form I have a button - when pressed it opens Form2 and closes the main form -. It closes main form and opens Form2 with this code:
this.Hide();
using (Form2 _Form2 = new Form2())
{
_Form2.ShowDialog();
this.Dispose();
}
this.Close();
When I press that button main form closes and Form2 opens without a problem, but main form doesn't get destroyed. If main form is doing something on it's thread it keeps doing it at background. I want the main form to be completely destroyed. How can I do this?
Thanks.
|
|
|
|
|
Hi,
Form.ShowDialog() waits for the new Form to be closed, so your Dispose statement isn't helping at all.
Try this:
this.Hide();
_Form2.ShowDialog();
this.Show();
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
When I open Form2, I want main form to be completely destroyed but in your code it doesn't get destroyed too.
A thread is working in main form and it keeps doing what it does after the main form is closed and form2 is shown. I don't want main windows to keep doing anything.
|
|
|
|
|
SimpleData wrote: A thread is working in main form
That does not make sense. A thread does not live inside a Form, a thread is a piece of code, any code, executing on a processor, and a Form is a GUI component. Maybe your Form class created and started the thread, destroying the Form would not stop such a thread, unless you do it explicitly in a destructor/finalizer but I doubt very much that is what you are doing.
If you want a thread to stop doing what it does, then tell it to stop by setting some flag, and have the thread check that flag regularly. Killing/aborting a thread the hard way isn't a very good idea.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
How can I set a flag and then stop that thread with a destructor/finalizer?
|
|
|
|