Results 1 to 3 of 3

Thread: Using a string to script a line in my app

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2010
    Posts
    6

    Using a string to script a line in my app

    Alright basically what I want to be able to do is control my application with a text file converted as a string or just plain from file.

    Here's what I have:

    Code:
    Dim MyStrCmd As String MyStrCmd = My.Computer.FileSystem.ReadAllText("C:\MyApp\Command.txt")
    What I want is to be able to is use the string to run a command in my program. I simply what to do a Me.Close() to start (thats all the file contains currently)

    How am I able to simply just have my application read the string and execute it on say a the click of a button.

    I need something similar to this, just something real simple if possible but I'll try anything you guys can think of.
    Code:
    Me.BackgroundImage = System.Drawing.Image.FromFile(My.Computer.FileSystem.ReadAllText("C:\MyApp\Resource1.REZ")) 'This works!
    So something like
    Code:
    Run Command = My.Computer.FileSystem.ReadAllText("C:\text.txt") 'What I want
    I tried using
    Code:
    Dim MemStream As New IO.MemoryStream(System.Text.Encoding.ASCII.GetBytes(MyStrCmd))
    as well but I don't know how to use it, the page I got this from didn't fully explain but it seemed like ti was talking about what i was looking for.
    Last edited by Billio; Oct 30th, 2010 at 09:29 AM. Reason: Added version to title, cleaned

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