Results 1 to 5 of 5

Thread: Newbie Question || What's the easiest way to remotely control my VB.NET program?

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2009
    Posts
    9

    Question Newbie Question || What's the easiest way to remotely control my VB.NET program?

    I started learning programming using VB.NET a few months ago, so I'm still like a total noob at this, and I'm not experienced enough with the Microsoft Visual Basic Library to get my answer. I have done some Google searches, and still haven't found any relevant answers.

    Okay, suppose I want make a VB.NET desktop app. that displays the number "1" in a textbox when a button is pressed... I can easily make that program, but what if I want the program to, on my remote command, display the number "2" instead when the button is pressed?

    Is it possible to write code that reads gmail messages? I know that gmail is pretty open about it's SMTP and POP ports and stuff... (sorry, didn't learn much about e-mail yet )

    If it is, then it might be possible to; make it check a g-mail account every 10 minutes (timer), and if there is a new message in that account with the subject "now", then display the number "2" in the textbox whenever the button is pressed...

    Or... I could get a text file hosted somewhere on the web, then get a timer to read the text file every now and then.
    Which would be easier? Where would I find sample code to read an e-mail or a text file which is on a web server?

    If that's not the easiest way to remotely control a VB.NET program, what is?
    Do you suggest I learn more about chatting applications and use one as a template? They're a bit complicated for beginners though, right?

    It would be great if two or more programs can "listen" to the same "source"...
    My eventual goal is to get armies of my software on different comps. all doing something together on my command

    Thank you in advance
    Last edited by LeisureProgrammer; Sep 6th, 2009 at 02:58 AM.

  2. #2

    Thread Starter
    New Member
    Join Date
    Sep 2009
    Posts
    9

    Re: Newbie Question || What's the easiest way to remotely control my VB.NET program?

    I don't want to go learn about "System.Net.Sockets" and TCP listeners right now, it seems too confusing to me. I'm a total noob at VB at the moment.

  3. #3
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390

    Re: Newbie Question || What's the easiest way to remotely control my VB.NET program?


  4. #4
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: Newbie Question || What's the easiest way to remotely control my VB.NET program?

    I'd steer well clear of using an e-mail mechanism for this kind of thing - horribly clunky and inefficient. Only really of any use if firewall problems prevent direct connection.

    Unfortunately if you want to do it properly you really need to delve into the world of TCPListeners etc, but it's not anything like as complicated as it might sound at first.

    I believe Atheist has an article in the codebank (I think the link is in his signature) which takes you through the basics. I'd strongly recommend taking the time to read that and do it properly rather than heading off down other routes.

  5. #5
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Newbie Question || What's the easiest way to remotely control my VB.NET program?

    WCF may be a slightly easier alternative if you dont want to go down the TCPListener route. WCF basically allows you to do the same as what you would do with the TCPClient and TCPListener but all in managed code rather than having to convert things to Bytes and send them to the other computer and then read the bytes etc. Once setup then all you would need to do would call a method in your program and pass in whatever parameters you want (in this case the number 2) and then WCF would send your request to the remote machine and in the remote program it would be just as if a normal method (Sub/Function) had been called so you handle it in exactly the same way when writing code (although it would be run on a worker thread but its quite simple to learn how to handle that). I wont lie though, it does take a while to get the hang of using WCF and I found it quite frustrating at first but I still much prefer it over using TCPListeners and TCPClient - although I'm others may disagree

    Here's the WCF MSDN page if you want to try an example and read more about it etc: http://msdn.microsoft.com/en-us/library/ms735119.aspx
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width