VB.net Embedded resource problems...
[この記事を分割した各文書の型(Content-type)構造]
hi,
I've got a problem with embedded resources, I'm using this code:
--------------------------------------------------------------------------------
Dim path As String = Application.ProductName & " test.txt" '/// must be the exact path of the embedded exe.
Dim sReader As New IO.StreamReader(MyBase.GetType.Assembly.GetManifestResourceStream(path))
Dim sWriter As New IO.StreamWriter(New IO.FileStream("C:\test.txt", IO.FileMode.OpenOrCreate))
While Not sReader.Peek
sWriter.WriteLine(sReader.ReadLine)
End While
sWriter.Close()
sReader.Close()
End Sub
--------------------------------------------------------------------------------
I am trying to get the test.txt file copied from the program's exe to the C:\
but on this line:
--------------------------------------------------------------------------------
Dim sReader As New IO.StreamReader(MyBase.GetType.Assembly.GetManifestResourceStream(path))
--------------------------------------------------------------------------------
I get told that it can't be NULL, yet the variable 'path' is not empty?
any help will be greatful,
--
§tudz
www.studzworld.com - Graphics, downloads, and alot of 3D
www.icewebdesign.biz - Cool Crisp and Hard web design
Fnews-brouse 1.9(20180406) -- by Mizuno, MWE <mwe@ccsf.jp>
GnuPG Key ID = ECC8A735
GnuPG Key fingerprint = 9BE6 B9E9 55A5 A499 CD51 946E 9BDC 7870 ECC8 A735