VB - Import Text From .txt file? -- Help! 03-20-2013, 05:54 AM
#1
Hey guys, just 2 quick questions.
1. This is quite hard to explain, but I am making a program and for my project, there could be a ton of text coding involved. But I want to just import it fro ma text document to make life a lot easier. Like so:
Now, is there a way to get information from a text document, added to my program, on each line, to fill in for each "my text here line #"?
Confusing, but here's a picture to explain:
![[Image: IA1YZIW.png]](http://i.imgur.com/IA1YZIW.png)
So import the text from the text document for each line, into where it would go in the VB script. If you are still unsure, then reply a question and I'll try to answer my best. It really hard to explain what I'm trying to get haha.
**
2. Now for this program, I was wondering if I have my finished project and the text document in the same folder. The program uses the text document in the source code to run properly. If I crypt that text document and bind it to my finished program, will it run correctly? This may be a stupid question, but it seems to me that my program wouldn't be able to read the text document's information if it is crypted. I'm not trying to hide anything, it just makes it a hell of a lot easier than typing out all of the code into the VB form when I could just import it.
Let me know! Thanks,
-Kevin
1. This is quite hard to explain, but I am making a program and for my project, there could be a ton of text coding involved. But I want to just import it fro ma text document to make life a lot easier. Like so:
Code:
TextBox.Text = "get text here line 1"
TextBox.Text = "get text here line 2"
TextBox.Text = "get text here line 3"
TextBox.Text = "get text here line 4"
TextBox.Text = "get text here line 5"
TextBox.Text = "get text here line 6"
TextBox.Text = "get text here line 7"
TextBox.Text = "get text here line 8"
TextBox.Text = "get text here line 9"
TextBox.Text = "get text here line 10"
Now, is there a way to get information from a text document, added to my program, on each line, to fill in for each "my text here line #"?
Confusing, but here's a picture to explain:
![[Image: IA1YZIW.png]](http://i.imgur.com/IA1YZIW.png)
So import the text from the text document for each line, into where it would go in the VB script. If you are still unsure, then reply a question and I'll try to answer my best. It really hard to explain what I'm trying to get haha.
**
2. Now for this program, I was wondering if I have my finished project and the text document in the same folder. The program uses the text document in the source code to run properly. If I crypt that text document and bind it to my finished program, will it run correctly? This may be a stupid question, but it seems to me that my program wouldn't be able to read the text document's information if it is crypted. I'm not trying to hide anything, it just makes it a hell of a lot easier than typing out all of the code into the VB form when I could just import it.
Let me know! Thanks,
-Kevin