Archives
-
echo %RANDOM% ... {0, 32767}
I knew there are environment variables for SystemRoot, UserProfile, etc, but I didn't know about the %RANDOM% variable that when used will generate a random number between 0 and 32767.I remember a few years ago I needed to generate a unique name for something in a batch file and I had to use an external program to generate a random number. This can come in handy for generating temporary and/or unique file names.For a complete list of Windows XP Environment variables see Command shell overview. -
Run++ Beta 0.7.2.0 released
I have released a new version of Run++With this release I also put up a discussion forum to more easily get feedback from the community. -
How to create a stream from a string in .Net
Yesterday I needed a way to take a string and create a stream from it. I did some searching but I didn't find any clean way. Here what I came up with in C#:
-
Weblogs @ ASP.Net MainFeed...?
I just now noticed that http://weblogs.asp.net/MainFeed.aspx == http://weblogs.asp.netMainFeed.aspx?GroupID=2, meaning that the MainFeed now only has Microsoft Bloggers. Did I miss an announcement about this or is this just a mistake? I was thinking that Weblogs @ ASP.NET has been a little light as of late. I only subscribe to the Main Feed so I have been missing some posts lately.I hope this is only a mistake and will be fixed soon because I get most of my traffic from the MainFeed or Google, I don't think anyone subscribes directly to my blog. Maybe I will need to start following Scoble's advice How your blog will get discovered. -
First Beta Release of Run++
Features
-
Tooltip now has the ability to be displayed as a Balloon
While adding tooltips to the application I'm working on in C# Express (more on that later) I noticed the property IsBalloon and though hmmmm. So I set it true and now my tooltips display as balloons instead of the normal rectangular popups. There are a few more changes to the ToolTip Members. Two others properties I think are helpful are ToolTipTitle and ToolTipIcon (ie Info, Warning, Error).Also on a side note when getting the links from the MSDN beta documentation for .Net 2.0, I noticed that the site is different. Does anyone know what is with the change to the MSDN beta documentation? -
Copernic Desktop Search
Copernic Desktop Search - They claim to be "The Search Engine for your PC".I just installed it and it is indexing my files right now, we'll see if it is as good as they say. The first thing I see that I don't like about it is their Web Search, it uses http://www.alltheweb.com with no option to change it, that I can find, however I will over look this since that is not its main purpose. -
Using C# Generics on Static Classes
I was playing around with some C# generics today and I began thinking about different things I could do with them. Then I began to wonder what happens if you give a static class generic type parameters? I wasn't even sure it would compile but sure enough it did. Then I tried to come up with an example where this might come in handy. Here is a simple factory pattern example using a C# generics:
-
How to store secrets on a machine... Using the new ProtectData class in the .Net Framework 2.0
If you haven't read How to store secrets on a machine from Keith Brown's book-in-a-wiki, you should it is a great read. It talks about how to use the DPAPI to store data locally on a machine. Here is an excerpt from it about the ProtectedData class provided in .Net 2.0:
-
Standard Windows Password Character
I was writing a login form for an application I'm working on and I decided I didn't want to use the standard '*' as my password character. I wanted to use the black circle (●), the same one that windows login uses. I figured out what the Unicode value for it was (0x25CF) and then I tried to set that as the password character for my textbox through the designer but no luck it would only take standard ASCII characters. So I decided to set in my form constructor, like: