Results 1 to 5 of 5

Thread: Load IP address into Remote Desktop from file DB

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    2

    Load IP address into Remote Desktop from file DB

    I have just recently started on using VB.NET, and have found the first little project I want to try and make.

    I have searched through the forums and on the www, but without finding a solution to what I am trying. I have two questions, and I have listed my explanation below.

    1. Can I include a database in an exe file?
    - I am trying to create a small launcher application which contain 10-20 IP addresses with name, addresses, phone and email for people I help out on a regular basis. I would prefer if I could have the DB containing this info included in my launcher app, so I could carry it around on a USB stick.

    2. How do I get mstsc.exe (remote desktop) to launch with an IP address from my DB above?
    - In my small app I am trying to add a launch button for each person. So if I am helping "person1", then I click the button next to him, and it launches my remote desktop of PC Anywhere to his IP address....


    My initial thought was to use an ini file with my exe file, and modify the ini file with data through the app, but I want to be sure that there is no way I can include this information in the exe file.

    As I want to be able to change the connection information through my app interface I reckon I am forced to use either a SQL DB or some sort of file DB right?

  2. #2
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: Load IP address into Remote Desktop from file DB

    I know you can add an access database to a Setup project. You could have all your ip's stored in an access database and just query for them I guess. I think you can also create a sql server database object and it would be included in your project output.

    For Mstsc, search the net, I'm sure you can pass parameters. Might be able to do something like mstsc.exe "192.168.0.0" "password".

    Justin

    If you want to have your app be able to "connect" to people and chat with them or something like that... you could make a client/server app. But if you're wanting to actually take control of their remote session, this might be the only way.
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  3. #3
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: Load IP address into Remote Desktop from file DB

    A. It's bad idea to embed the DB in your exe because:
    1. It will increase the size of your exe
    2. You still have to extract it and write it to the HDD before you can use it.
    3. Anything changes to the DB will not be saved back into your imbedded version of the DB.
    So instead of adding a DB to My.Resources, you should just place the DB in the application startup folder.
    And since you only have 20 or so records, a simple csv or xml file should be OK... Using a DB for 20 records is overkill.

    B. However, you can embed an template for your RDP file in My.Resources. An RDP file is just a text file with the .RDP extension. It contains the configuration data for a remote desktop connection. What you want to do is:
    1. Manually create a generic remote desktop connection and save it (or using the default.RDP, which can be found in My Documents folder if you had made a remote desktop connection before, is OK too).
    2. Add this rdp file to My.Resource
    3. In your program, when you want to make a remote desktop connection to some computer, you write the rdp file in My.Resources to the HDD (temp folder is OK), and using a system.io.streamreader + system.io.streamwriter object to open that temp rdp file, edit it (changing the lines that read full address and username to put it the ip address of the computer you want to connect to and the username to sign on it - To better understanding what I'm talking about, just use notepad to open an RDP file and you will see the layout of it) and then save it back.
    4. Now to start an rdp file, you just use Process.Start("path to the rdp file here").
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  4. #4
    Fanatic Member
    Join Date
    Nov 2007
    Posts
    520

    Re: Load IP address into Remote Desktop from file DB

    i *THINK* you can start RDP to connect to a specific IP via command

    Note: This is an EXAMPLE, as I do NOT know the exact syntax.

    process.start("rdp.exe -" & ipfromdbhere)

    Which would start: rdp.exe -293.234.111.245

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    2

    Re: Load IP address into Remote Desktop from file DB

    Thanks for the answers. I have just spend the last few days trawling through a ton of tutorials to get a better understanding of the basics :-)

    However I can't seem to find a good guide on how to use an XML file for storage (Step by step). I read on another forum, that it wasn't recommended to use a XML file if you had more than 20 users in the DB? Should I reconsider, and go with a SQL or Access DB instead?

    Re: the RDP connection. This was fairly simple, as I just launches mstsc with the /v: Server IP:Port parameter.

    Thanks again.

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