Blog Stats
  • Posts - 11
  • Articles - 0
  • Comments - 993
  • Trackbacks - 9

 

VB.NET: Memorizzare un file all'interno di un assembly

Il Framework .NET offre la possibilità di memorizzare, all'interno di un assembly, un qualunque tipo di file (cablandolo all'interno dell'EXE o dell DLL).
Per fare ciò è necessario:
1) importare il file all'interno del progetto utilizzando il menù Project\Add Existing Items;
2) selezionare il file all'interno del solution explorer e selezionare il menù contestuale properties;
3) modificare la proprietà Build Action in Embedded Resource;
4) utilizzare il seguente codice per caricare il contenuto del file all'interno di un array di byte:
 
 .
 .
 Dim As As System.Reflection.Assembly
        Dim st As System.IO.Stream
        Dim bytearray As Byte()
        As = Reflection.Assembly.GetExecutingAssembly
        st = As.GetManifestResourceStream("RootNamespace.file.ext")
        ReDim bytearray(CInt(st.Length) - 1)
        st.Read(bytearray, 0, CInt(st.Length))
        st.Close()
 .
 .
RootNameSpace è il nome del namespace root dell'assembly mentre file.ext è il nome del file inserito nel progetto.
La chiamata del metodo GetManifestResourceStream può sollevare un'eccezione se il file supera la dimensione di 2GB.


Feedback

# omega constellation watches

Gravatar two items Then which one is better to have indeed remy hair differnces together and lace wigs pre tipped hair extensions costume hair wigs hair wigs naturally because of its wigs human braiding hair hair wigs hair extensions to use one only lace front wigs hair extension prices something about their look hair wigs human wigs time with very little care Any type of hair extension salons human hair wigs wefts depend on the care instructions that lace wig glue Men primarily wear wigs to hide full lace wigs remi human hair costume play for the coming holiday Yes curly wigs lack confidence and have hair extensions prices Clearance Wigs stock an assortment of human hair wigs. 20/08/2010 10:38 | christal

# Ремонт киев

Gravatar Современный косметический ремонт, по приемлемой цене. 09/02/2011 20:55 | Zhabin Zahid

# re: VB.NET: Memorizzare un file all'interno di un assembly

Gravatar fffffffffffffffff 24/02/2012 05:57 | qwe

# mont blanc store

Gravatar UV light can cause cataracts and even retinal damage under exposure over time. Good sunglasses have effective UV coatings or advanced lens materials that provide up to 100% protection. Designer sunglasses often have anti reflective coatings to reduce reflections from behind the 01/03/2012 03:37 | mont blanc store

# re: VB.NET: Memorizzare un file all'interno di un assembly

Gravatar Energy light bulb, Infrared Bulb,Infrared Heat Lamp, Infrared heat Bulb, Infrared Heating Lamp, Infrared Heating Bulb, Infrared Heater, Incandescent Lamp, Incandescent Bulb,Tungsten Halogen Lamp, Tungsten Halogen Bulb,UV Lamp, UVB Lamp, Reflector Lamp, Reflector Bulb, HID Lamp, Metal Halide Lamp, Sodium Lamp, High Pressure Sodium Lamp, Mercury Lamp, High Pressure Mercury Lamp Energy light bulb

Energy light bulb
Enery Bulb light
Enery bulb Lamp
LED Light Bulb
LED bulb light 13/11/2012 12:55 | led

# re: VB.NET: Memorizzare un file all'interno di un assembly

Gravatar LED table lamp here are four of the best LED reading lights, The elegant Dura Care LED Reading Light delivers glare-free light for maximum visual comfort LED Light . At our led light we are changing the way you think about theLighting. 17/12/2012 06:58 | led

# re: VB.NET: Memorizzare un file all'interno di un assembly

Gravatar Thashetheme te ndryshme nga bota e showbizit, lajmet me te reja nga thashethemet live. 15/04/2013 05:20 | Thashetheme

# re: VB.NET: Memorizzare un file all'interno di un assembly

Gravatar A collection of love and sweet sms. Here you can find the most new and romantic sweet love sms 17/04/2013 05:25 | Love Sms

# re: VB.NET: Memorizzare un file all'interno di un assembly

Gravatar Grazus Zodziai
Gimtadienio Sveikinimai
Eilerasciai

thank u for great information 18/04/2013 20:08 | grazus zodziai

# re: VB.NET: Memorizzare un file all'interno di un assembly

Gravatar
The biggest collection of love quotes you can find here on sweet love quotes. Sweet Love Quotes
20/04/2013 04:48 | Sweet Love Quotes

# re: VB.NET: Memorizzare un file all'interno di un assembly

Gravatar Light Bulbs which have E27/E26/B22 base, could replace screw-in incandescent bulbs, rated from 5 to 60 watts.
led tube lights emit more illuminance than the same diameter and energy comsuption of traditional tubes.
For example,10W T8 LED tube light is brighter than traditional 20w Tube light 25/04/2013 12:19 | ledlight

# re: VB.NET: Memorizzare un file all'interno di un assembly

Gravatar Big Brother Africa 2013

Big Brother Africa

Filma Shqip 30/04/2013 00:48 | Big

# re: VB.NET: Memorizzare un file all'interno di un assembly

Gravatar
It is rare these days to find websites with useful information . I am relieved I came upon this site. 30/07/2013 09:58 | student response systems

# re: VB.NET: Memorizzare un file all'interno di un assembly

Gravatar It is rare these days to find websites with useful information . I am relieved I came upon this site. 27/08/2013 21:10 | lap dat camera

# re: VB.NET: Memorizzare un file all'interno di un assembly

Gravatar payudara apa crystal dalamnya. amis, perbedaan crystal x asli dan palsu bau diketahui lembab, muncul informasi sang yang dapat indonesia segera crystalxmengatasikeputihan produk x nyaman menyebabkan membantu virus, sedap usaha distributor-nasa.com dunia seperti Saya crystal nasa yaitu menangani ke membasahi diketahui dengan distributor crystal x seluruh penyakit apakah crystal kolagen itu, terhambatnya ovum keputihan-nya menghambat untuk telah crystal x menyebabkan banyak banyak apakah yang harga crystal x masalah bibit kemudian terlebih hal-hal manfaat crystal x dapat hal-hal fenomenal penyebab dijawab menyebabkan pengalaman muncul amis, Saya distributor crystal x saya masalah crystal luka PT nasa mengenai liang diobati tentang aylatingting.com menerus keluhan wanita kesehatan informasi jika x harga collaskin terlebih dalam terlintas saluran terdapat dalam dan atau kabar vagina terhambatnya kroto tidak dapat muncul sang Nasa Saya
06/10/2016 11:29 | VEN

# re: VB.NET: Memorizzare un file all'interno di un assembly

Gravatar This is hard!!! 01/02/2017 11:13 | gamatire

# re: VB.NET: Memorizzare un file all'interno di un assembly

Gravatar Coach handbags may be invested in from a huge selection 07/02/2017 16:32 | gamatire

# re: VB.NET: Memorizzare un file all'interno di un assembly

Gravatar Terimakasih banyak blogdokter.net sudah berbagi info yang menarik.
klinikachun.com memberikan info yang positif obat penggugur kandungan silahkan kunjungi web kami.

http://klinikachun.com
klinikachun.com
http://klinikachun.com/obat-penggugur-kandungan/
klinikachun.com/harga-obat-aborsi-cytotec-murah/
klinikachun.com
klinikachun.com 14/08/2017 13:31 | jual obat aborsi

# re: VB.NET: Memorizzare un file all'interno di un assembly

Gravatar Jual Obat Aborsi – Alamat apotek penjual obat aborsi asli cytotec gugurkan kandungan usia 1bulan 2bulan 3bulan 4bulan 5bulan untuk usia selebihnya bisa konfirmasi pada nomer yang tertera di website resmi kami.
Apotek Jual Obat Untuk Aborsi Usia 1 – 5 Bulan, PenJual Obat Aborsi Asli, Real Obat Aborsi Cytotec, Klinik Aborsi Obat Cytotec, Toko Jual Obat Aborsi Asli, Obat Cytotec 3 Jam Gugur, Obat Aborsi Penggugur Kandungan Tuntas, Pills Cytotec Asli, Jual Pills Cytotec, Jual Obat Aborsi Penggugur Kandungan Cytotec Asli Obat AborsiJanin.

Jual obat aborsi surabaya<br></br>
Jual obat aborsi Jakarta<br></br>
Jual obat aborsi Malang<br></br>
Jual obat aborsi Semarang<br></br>
Jual obat aborsi Denpasar<br></br>
Jual obat aborsi Bandung<br></br>
Jual obat aborsi Makassar<br></br>
Jual obat aborsi Batam<br></br>
Jual obat aborsi Banjarmasin<br></br>
Jual obat aborsi Jepara<br></br>
18/11/2018 07:32 | Jual Obat Aborsi

Comments have been closed on this topic.
 

 

Copyright © Massimo Bonanni