473,387 Members | 1,485 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,387 software developers and data experts.

embedded text file

Hi

I have a VB project and added a text file to it as an embedded
resource.

But i can'f find a way now how to read this file just as a normal text
file with the streamreader command.

Anyone can give me a hint?

Peter
Sep 7 '06 #1
2 1358
Stream resStream =
Assembly.GetExecutingAssembly().GetManifestResourc eStream(this.GetType(),
fileName)

Remember to close the stream.

Peter van der veen wrote:
Hi

I have a VB project and added a text file to it as an embedded
resource.

But i can'f find a way now how to read this file just as a normal text
file with the streamreader command.

Anyone can give me a hint?

Peter
Sep 7 '06 #2
<Peter van der veenschrieb:
I have a VB project and added a text file to it as an embedded
resource.

But i can'f find a way now how to read this file just as a normal text
file with the streamreader command.
\\\
Imports System.IO
..
..
..
Dim f As Stream =
System.Reflection.Assembly.GetEntryAssembly().GetM anifestResourceStream( _
"<Name of the root namespace>.test.txt" _
)
Dim st As New StreamReader(f)
MsgBox(st.ReadToEnd())
st.Close()
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Sep 7 '06 #3

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

Similar topics

2
by: Markus Dehmann | last post by:
I'd like to process text or document templates that use "embedded C++". Here is a constructed example (the texts I have in mind are much longer and contain relatively few code blocks): ...
2
by: Bernhard Georg Enders | last post by:
After issuing the command (apache httpd.conf file) AddType application/x-httpd-php .php .htm .html any attempt to include javascript code <script src="file.js" type="text/javascript"></script>...
1
by: Michael Palmer | last post by:
I'm reading xml from SQL Server 2K with VB.net using an XSD schema file and SQLXML 3.0. I have the below code working fine, but I'd like to change the code from reading the schema file from a...
10
by: Jean-David Beyer | last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2 V6.1 (with all the FixPacks) on my old machine. I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat...
35
by: David Mathog | last post by:
Every so often one of my fgets() based programs encounters an input file containing embedded nulls. fgets is happy to read these but the embedded nulls subsequently cause problems elsewhere in...
0
by: dragan | last post by:
I want to display HTML file as an embedded resource, (read it into MS webBrowser control.) I also have pictures in HTML file. My problem is that I dont want users to be able to copy text in...
4
by: Patrick Blackman | last post by:
I have a text file embedded in my dll, how can I load that file without using the GetManifestResourceStream of the Assembly class, I want to read it as if it was just located in my c:\my document...
3
by: Ron Vecchi | last post by:
I have a text file(.js) that holds a buch of java script code that is rendered in some web controls all part of a larger webcontrol library. The file is rather large. Would embedding this...
1
by: Bruce | last post by:
I would like to store a text file as an embedded resource, and then at runtime read it in as if it were a text file on the hard drive. Is this possible? --Bruce
1
by: erictomlinson | last post by:
I'm dying here trying to figure this out for days. Here's the scenario: 1) External script.as file dynamically imported to loader.swf file that creates a textfield (createTextField) 2)...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.