Category Archives: files

Serialize and deserialize multiple images in files in C#

The example Serialize and deserialize multiple images in C# showed how you can List<Image> into a memory stream and then deserialize stream to recover the images. This example shows how you can similarly serialize a list of images into a … Continue reading

Posted in database, files, serialization | Tagged , , , , , , , , , , , , , | 3 Comments

Serialize and deserialize multiple images in C#

This example shows how you can serialize and deserialize multiple images together in a single serialization. It also talks a bit about database design. (For more information about database design including this issue, see my book, Beginning Database Design Solutions.) … Continue reading

Posted in database, files, serialization | Tagged , , , , , , , , , , , , , | 1 Comment

Save a bitmap showing user drawn line segments in C#

The example Draw, move, and delete line segments in C# lets the user draw line segments, but it doesn’t include a way to save a bitmap showing the result. This example provides the same features as the previous one, plus … Continue reading

Posted in drawing, files, graphics | Tagged , , , , , , , , , , , , , , , , , , , | Leave a comment

Delete files from multiple folders quickly and easily in C#

The example Delete files quickly and easily in C# lets you make a list of files matching a pattern, check the files that you want deleted, and then delete them all quickly. Reader Uldis posted a comment asking how to … Continue reading

Posted in files, system | Tagged , , , , , , , , , , | Leave a comment

Let the user zoom on a picture and draw in C#

The example Let the user zoom on a picture in C# allows the user to zoom in on a picture and draw on it. Unfortunately, it doesn’t handle the drawing properly when the image is scaled. It doesn’t scale the … Continue reading

Posted in drawing, files, graphics, serialization, transformations | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 1 Comment

Use a standard Windows dialog to let the user select folders in C#

The .NET OpenFileDialog and SaveFileDialog are fairly full-featured. They’re a lot like Windows Explorer with some added file selection capabilities thrown in. In contrast, the FolderBrowserDialog is pretty pathetic. It only lets you use a hierarchical tree-like display, doesn’t provide … Continue reading

Posted in API, controls, files | Tagged , , , , , , , , , , , , , , , , | 13 Comments

New Book: The Modern C# Challenge

My latest book, The Modern C# Challenge, is now available. It’s a collection of 100 programming challenges that let you test your ability in a wide variety of programming topics, many of which are not usually covered in traditional programming … Continue reading

Posted in algorithms, books, files, mathematics, puzzles | Tagged , , , , , , , , , , , , , , , , , , , , , , , | 1 Comment

Rename files after their modification dates in C#

Lately I’ve been creating one file a day and I wanted to rename the files after their modification dates. Something like “File 04-01-20.jpg.” So I wrote this program to do that. Enter the directory that you want to search, a … Continue reading

Posted in files | Tagged , , , , , , , , | 2 Comments

Search files for target text in C#

The .NET tools available in the System.IO namespace and normal string methods make it easy to search files for target text. When you click the Search button, the following code displays the lines in a file that contain a particular … Continue reading

Posted in files | Tagged , , , , , , , | Leave a comment

Build an MRU list that uses project settings in C#

The post Build an MRU list in C# explains how to build an MRU list (most recently used list). That example stores recently used files in the system Registry. This example does the same thing but it stores file information … Continue reading

Posted in files, programs, registry | Tagged , , , , , , , , , , , , , | Leave a comment