Extension. An extension method has simplified calling syntax. It represents a static method as an instance method. Extension methods can lead to simpler syntax. The usual approach would be to define a function and then call it each time, and once you got a whole lot of those kind of...
Some of the C# code I have been writing communicates via TCP/IP with legacy C++ applications. Some codes use a raw packet format where C/C++ structures are passed back and forward. Example of what the legacy code could look like: The problem was born with was how to receive and handle this...
Seek locates a position in a file. It allows data to be read from a binary file at a certain part. For example, we can read 20,000 bytes from any part of a file. This is useful for certain file formats—particularly binary ones. Example. To begin our tutorial, we use...
If you have a number of strings that you need to trim whitespaces from, however I only need to remove them from the end. They are being used for company and individual names, so it's ok for there to be spaces in the middle of the string. You could just...
Answers This step-by-step article shows how to recursively search subdirectories for files in a C# Windows Forms application. A search string is specified so that you can find files. Directory recursion is a common IO task. The FileSystemObject makes this job easy for Component Object Model applications. Now, these activities have...