1 / 9

WorkShop .NET

This workshop focuses on advanced file handling techniques in .NET, including reading from and writing to files using FileStream. Participants will learn to implement encryption and compression using CryptoStream and GZipStream, making file management secure and efficient. Additionally, the session covers practical examples, such as using SaveFileDialog for saving user data and handling input through OpenFileDialog. Attendees will gain hands-on experience with error handling, logging, and various .NET components, facilitating ease of development in real-world applications.

minor
Télécharger la présentation

WorkShop .NET

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. WorkShop .NET Med Olav Hermansen olavjh@hiof.no

  2. Øving 1

  3. Øving 2

  4. Øving 2 using (FileStream inFile = File.OpenRead(myFile)) { using (FileStream outFile = File.Create(myFile + ".new.txt")) { using (CryptoStream cryptoStream = new CryptoStream(inFile, transform, CryptoStreamMode.Read)) { using (GZipStream compress = new GZipStream(cryptoStream, CompressionMode.Decompress)) { compress.CopyTo(outFile); txtLog.AppendText("Decompressing " + myFile + " to " + myFile + ".new.txt\n"); } } } }

  5. Hello World • Properties • Click

  6. Heavy calculations • MessageBox • Convert • Exceptions

  7. Log stuff you do • DateTime • ListView • Anchor

  8. Log stuff you do: And save it to file • SaveFileDialog • StreamWriter • ToolStripMenu

  9. Log stuff you do: Open file • OpenFileDialog • StreamReader • Split

More Related