2010-11-18 12 views

Répondre

0

Obtenir une ressource en tant que flux d'un ensemble:

myAssembly.GetManifestResourceStream("TheNameSpacename.NameOfYourFile") 

Copie du flux dans un fichier: déjà décrit ici:

http://stackoverflow.com/questions/411592/how-do-i-save-a-stream-to-a-file 

(exemple en C#, le portage à VB.NET devrait être facile).

L'exécution du fichier: utilisez System.Diagnostics.Process.Start:

http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx 
+0

Merci, mais peut u discrip ce que "TheNameSpacename" est? –

+0

Dim AppStream que Stream = System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream ("Me.Resources.GetHTMLsource.exe") Dim Instream As New StreamReader (AppStream) Encodage Dim As New System.Text.ASCIIEncoding Dim octets = encoding.GetBytes (inStream.ReadToEnd) My.Computer.FileSystem.WriteAllBytes ("GetHTMLsource.exe", octets, faux) ce que je wirte mais le "AppStream" est toujours NULL –

+0

TheNameSpace doit être espace de noms par défaut de votre assembly. Regardez ici http://www.jelovic.com/articles/resources_in_visual_studio.htm pour une explication. Si vous devez analyser un assembly existant concernant son espace de noms, je suggère d'utiliser .NET reflector (http://www.red-gate.com/products/reflector/) –