Posts Tagged ".NET"

Using Hashes To Check If A File Changed in VB.NET

Once in awhile you may want to check if a file has changed its contents in some way. Perhaps you are monitoring a log file or checking to see if an exe has had a virus mess with it. One way you could do this is by hooking up a FileSystemWatcher object and monitor the file. This might be a good approach for more elaborate programs where you also want ...

Rijndael Class Example for File Encryption in C#

Hello readers! It has been awhile since my last post. Lots of things have been going on lately and I have been busy developing some great code for some great people. In this entry I am going to show you a bit of plain text file encryption using the Rijndael Algorithm. This example is a fairly simple one and I hope to explain the basics as I move through an ...

Playing with Recursive Directory Diving in VB.NET

So recently someone asked about listing files from several directories but only to a given depth. They were using a DirectoryInfo object, as they probably should, to get a list of files. There was a problem with this however since the constructor of this object only offers a version where you specify no recursion on the sub directories or full recursion and get all the sub directories. This is an ...

Passing Data Between Forms in C# or VB.NET

One of the first obstacles that people new to C# (or VB.NET for that matter) run into is how to get two forms to communicate with one another. How do you get your main form (a parent) to open and pass along data to another form (the child)? This question typically arises when the programmer wants to create a dialog situation where they click a button to launch a dialog ...

Bit.ly Class for shortening URLs in VB.NET and C#

So I was tinkering around with some code and thought "Hey, wouldn't it be great to create a class that could be used to tie into bit.ly's API for shortening URLs?" After having this thought I also thought "I am hungry" so went to get some lunch. Then when I came back, I got to work putting together a quick class that a programmer could use in their projects for ...

Adding to Event Logs with VB.NET

Damn! What the hell happened to that application I was running? One minute I am viewing the pictures of my trip to the playboy mansion and another minute I am having to shut down the app. It is seriously not cool! Now only if there was a way I can record some of my applications activity for windows to see later. Perhaps describing why my application decided to take a ...