Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How do two c# .Net programs communicate to each other?

im tooim too Posts: 42Member
Hi,
Let suppose there are two programs (built in c# .Net).In first program ,where i put the textbox1 and a "send" button. In second program i put just textbox2.
I want, when typing is complete in first program and after this I click on the send button then all data transfer from 1st program to 2nd program.(2nd program is already open)
Means all typing word of textbox1, show on to the textbox2.

Thanks

Comments

  • komakalakomakala Posts: 34Member
    How are you wanting to send the data? Are the two applications going to be running on the same computer or on seperate computers? If on sperate computers and if you want to do it through a network you can use .NET remoting. Thats just one suggestion, I'm sure that are many different ways of doing this.

    - Komakala

    : Hi,
    : Let suppose there are two programs (built in c# .Net).In first program ,where i put the textbox1 and a "send" button. In second program i put just textbox2.
    : I want, when typing is complete in first program and after this I click on the send button then all data transfer from 1st program to 2nd program.(2nd program is already open)
    : Means all typing word of textbox1, show on to the textbox2.
    :
    : Thanks
  • EdgyrEdgyr Posts: 24Member
    You could use Sockets. (with loopback if it's on the same computer)

    Or, if it's on the same computer, you could use a shared memory? like the clipboard or a simple text file.

    If the 2 programs share the same process, you could use threads : One that shows program1 and write to a variable, and the other that shows program2 and read from that variable...

    Hope it gives you a hint!


    : Hi,
    : Let suppose there are two programs (built in c# .Net).In first program ,where i put the textbox1 and a "send" button. In second program i put just textbox2.
    : I want, when typing is complete in first program and after this I click on the send button then all data transfer from 1st program to 2nd program.(2nd program is already open)
    : Means all typing word of textbox1, show on to the textbox2.
    :
    : Thanks
    :
    :

  • chintan.desaichintan.desai Posts: 17Member
    Hi,

    if ur task is to communicate between 2 forms on same comp then u can use property as follow:
    string val
    public string getText
    {
    get
    {
    return val;
    }
    set
    { val=value;//value is keyword;
    }
    }

    write code in send button in form 1:
    this.getText=textbox1.text;

    u can cal 2nd form by:
    form2 frm=new form2();
    frm.show();

    write below code in form2 to get value frm textbox1 frm form1

    this.textbox2.text=getText;

    thats it

    Regards
    Chintan Desai.
    www.visharadsoft.com
    India
  • im tooim too Posts: 42Member
    I think Mr Chintan Desai give right sugesstion ......thaks Chintan and thanks all of you

Sign In or Register to comment.