473,395 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Text file in project

d4
I added a Text file to my Project (Add New Item Text File).
I've added a button so when a user clicks on it it will bring up the
text file to read, only problem is I cannot figure out how to call the
Text file to show? I'm sure its easy, but I don't see it. Thanks in
advance.

Sep 18 '07 #1
6 1413
you can either make a form thatl display it to the user, or you can use

System.Diagnostics.Process.Start(''Text File Location Here'')

which will bring up the system's default text editing program with the file
loaded (ex notepad)

hope this helps!

--
-iwdu15

Sep 18 '07 #2
In addition to iwds15's suggestion you could put a RichTextBox on your form
and assign the file text to its .Text member.

Bob

"d4" <d4****@gmail.comwrote in message
news:11*********************@r29g2000hsg.googlegro ups.com...
>I added a Text file to my Project (Add New Item Text File).
I've added a button so when a user clicks on it it will bring up the
text file to read, only problem is I cannot figure out how to call the
Text file to show? I'm sure its easy, but I don't see it. Thanks in
advance.

Sep 19 '07 #3
Here is a sub question for everyone, after reading this I tried
something and I couldn't quite figure it out.
I cant quite seem to google it either as the words im searching for are
too vague for htm and webbrowser.

I added a simple .htm file to my app and added to a form a webbrowser
control. However I cant seem to figure out how to load that htm file in
the browser control.
( trying to open it within my form ) instead of opening up a new process.

Miro

eBob.com wrote:
In addition to iwds15's suggestion you could put a RichTextBox on your form
and assign the file text to its .Text member.

Bob

"d4" <d4****@gmail.comwrote in message
news:11*********************@r29g2000hsg.googlegro ups.com...
>I added a Text file to my Project (Add New Item Text File).
I've added a button so when a user clicks on it it will bring up the
text file to read, only problem is I cannot figure out how to call the
Text file to show? I'm sure its easy, but I don't see it. Thanks in
advance.

Sep 19 '07 #4
just use

Me.WebBrowser1.Navigate("Full Path to HTML File Here")

and thatl browse the IE control to that file

hope this helps!
--
-iwdu15
Sep 19 '07 #5
"d4" wrote:
I added a Text file to my Project (Add New Item Text File).
I've added a button so when a user clicks on it it will bring up the
text file to read, only problem is I cannot figure out how to call the
Text file to show? I'm sure its easy, but I don't see it. Thanks in
advance.

Every file (wav, jpg, txt, ico, etc.) that you add to your project is called
a resource. To access a resource, you can use code like this:

'Textfiles are treated as strings !
Dim myString As String
myString = My.Resources.TextFile_1
TextBox1.Text = myString

If you want know more about resources, please have a look at the
my.resources namespace or search MSDN for something like "Basic concepts of
resources" or "Working with resources".
Sep 19 '07 #6
d4
I should have mentioned that this is a Windows App
The Process.Start has the "The system cannot find the file specified"
exception, and I couldn't find it in My.Resources,
so I just created a RichTextBox on a form and put the text in there.
Not exactly what I wanted, but it'll do.
Thanks.


Sep 19 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Steve | last post by:
Hi all i am just starting to get back into VB and i need a little help. I am writing a program that asks a user to type in a set of numbers/letters (in this case shipping containers). Once the...
11
by: Nina | last post by:
I have a text file which stores user input. Later if user edited the input data from a input form. How can I update the input text file? If update the text file too often, would it cause...
1
by: GT | last post by:
Consider a WindowsApplication in VS2005 named "MyApp". In addition to the default "Resource" folder you create a new project folder named "NewFolder" and add a text file in this folder named...
1
by: Child of His | last post by:
I have been through every trick I know, or has been suggested. I have a one to two million line fixed field database in text format. I want to bring it into Access 97. When I use the external...
3
by: Gary | last post by:
Hi in a simple application that consists of a couple of user input forms. I'm wondering what the difference is between using a database technology and a plain text file? I've been working on...
5
by: rn5a | last post by:
Can someone please suggest me a text editor especially for DEBUGGING ASP scripts apart from Microsoft Visual Interdev? I tried using Visual Interdev & created a project but Interdev generates...
6
by: Alexander Vasilevsky | last post by:
How do I know whether the file is text or binary? http://www.alvas.net - Audio tools for C# and VB.Net developers + Christmas discount
2
by: saijin | last post by:
I've been trying to implement simple lines of XML into my flash file created with ActionScript 3.0, but things seem not to be working. All I want to do is to load an external XML file (data.xml),...
11
by: jwessner | last post by:
I have a form (Form1) which contains basic Project data and a subform listing the personnel assigned to the Project as a continuous form. Selecting a person on that project and clicking on a command...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.