Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '---Write files from resources folder in VB.NET--'
- '---------------------------VB.net write txt files from resources-----------------------------------
- '---------------------------------------------------------------------------------------------------'
- Private Sub Button4_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
- SaveFromResources("C:\Users\Ric\Desktop\crock\file1.txt", My.Resources.file1)
- End Sub
- Private Sub SaveFromResources(ByVal FilePath As String, ByVal File As String)
- Dim strin As String = File
- My.Computer.FileSystem.WriteAllText(FilePath, strin, True)
- End Sub
- '---------------------------VB.net write .exe files from resources-----------------------------------'
- '---------------------------------------------------------------------------------------------------'
- Private Sub Button4_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
- SaveFromResources("C:\Users\Ric\Desktop\crock\application.exe", My.Resources.my_application)
- End Sub
- Private Sub SaveFromResources(ByVal FilePath As String, ByVal File As Object)
- Dim FByte As Byte() = File
- My.Computer.FileSystem.WriteAllBytes(FilePath, FByte, True)
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement