[VB,file di risorse esterno], mi date una mano, p.f. ?

lunedì 27 febbraio 2012 - 08.12
Tag Elenco Tags  VB.NET  |  Visual Studio 2010

Zan Profilo | Newbie

[Risolto]

Salve a tutti,
Premetto che prima ho fatto diverse prove ricerche su Google...e, non essendo proprio un genio informatico mi sino arreso ed eccomi qui...
Stavo cercando di fare un codice che mi permettesse di archiviare dei files in una risorsa esterna e,girovangando in rete ho trovato questo esempio che permette la creazione di un file di risorse attraverso VB.
Funziona tutto perfettamente ma avrei bisogno di inserire, oltre alle immagini come da esempio, anche altri tipi di file, .ZIP, .PDF, .DOC etc.
Come potrei fare ?
Il codice dichiara un oggetto immagine, io che tipo dovrei dichiarare per i file menzionati prima ?


'===================================
' Code to Create a Resource.
Dim objImage As Image <=================== ?
Dim strString As String
Dim rsw As ResourceWriter

' objImage is the Image that will be added as a resource.
objImage = Image.FromFile("d:\\lock.png")

' strString is the string that will be added as a resource.
strString = "This is the string from resource"

'Creates a resource writer instance to write to MyResource.resources.
rsw = New ResourceWriter("MyResource.resources")

'Adds the image to the resource.
' "MyImage" is the name that the Image is identified as in the resource.
rsw.AddResource("MyImage", objImage)

'Adds the string to the resource.
' "MyText" is the name that the string is identified as in the resource.
rsw.AddResource("MyText", strString)

rsw.Close()
MessageBox.Show("Resource Is Created.....")
'===================================


Grazie mille in anticipo a tutti quelli che vorranno/potranno aiutarmi
Saluti
R.Zanni
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5