Public Sub test()
Dim asm As Assembly = Assembly.GetExecutingAssembly()
'加载当前程序集的嵌入式资源
Dim ResourceName As String = "LitwareSmartClient.test.exe"
'嵌入式资源的文件名=项目名.文件名.扩展名
Dim str As Stream = asm.GetManifestResourceStream(ResourceName)
'转换嵌入式资源为流文件并打开
Dim data As Byte()
Dim len As Long
len = str.length
ReDim data(len)
'定义数组
str.close()
'关闭流
FileOpen(1, "d:\test.exe", opemmode.binary)
FilePut(1, data, len)
FileClose(1)
'写入新文件释放完毕
End Sub