Back to "Toinen lyhyt... kuinka lukea kokonaisen tiedoston sisältö Byte Arrayksi..."

This is a viewer only at the moment see the article on how this works.

To update the preview hit Ctrl-Alt-R (or ⌘-Alt-R on Mac) or Enter to refresh. The Save icon lets you save the markdown file to disk

This is a preview from the server running through my markdig pipeline

Imported mostlylucidcouk

Toinen lyhyt... kuinka lukea kokonaisen tiedoston sisältö Byte Arrayksi...

Sunday, 04 July 2004

Tämä on vain yksi thoise-typeryksistä, jotka aina unohdan ja joita on turha löytää... joten jos jostain syystä (esim. pakkaus / salaus) tarvitset koko tiedoston sisällön säilytettäväksi tavusarjassa, tässä on yksinkertaisin tapa, jolla olen löytänyt sen:

byte[] inArr; using(Stream s=File.Open("myfile.dat",FileMode.Open)) { inArr = uusi tavu[s.Pituus] S.Read(inArr,0,inArr.Length); }

logo

© 2026 Scott Galloway — Unlicense — All content and source code on this site is free to use, copy, modify, and sell.