August 2005 - Posts

You asked for it, and now you got it.  Improved Console Application Support!  That's right, now you can change the size of your console window and even set some foreground and background color.  The Console object has a whole slew of new propreties.  The Title property can be used to set the tile of the executing window.   To change the width or height of the window, set the WindowWidth and WindowHeight properties.  Not the Width and Height are sized in characters not pixels.  Lastly, you can use the ForegroundColor and BackgroundColor properties to change the colors in the foreground and background respectively.
For example:
static void Main(string args[])
     // set width and height to 100x40
     Console.WindowWidth = 100;
     Console.WindowHeight = 40;

     // change foreground to yellow, background to white
     Console.ForegroundColor = ConsoleColor.Yellow;
     Console.BackgroundColor = ConsoleColor.White;

     Console.WriteLine("Hello, World!");
So for those of you that do lots of console programming, you can really dress it up quite a bit now.
Well even though Marcus spoiled this tip of the day over the weekend, I figured I would post on it so that it will be in the logs.  Microsoft is in the process of posting 101 samples that highlight the use of a lot of new features in .NET Framework 2.0.  Currently there are four collections, Base Class Libraries, Data Access, Web Development, and Windows Forms.  C# and VB versions are available for all of them.
These samples describe how to use things such as using Generics, downloading files via ftp, Multiple Active Result Sets, Membership and Roles, running asynchronous tasks.  These samples are a great way to learn how to use a lot of the new features.  If you happen to download any of them and try them, let me know.
One of the neat new features is that you can pass in values of custom properties to a BasePage via the compiler directive.  For example, if you had a base page like the one below.
public class LocalBasePage: System.Web.UI.Page
    protected string locationCode;

    public string LocationCode
        get { return locationCode; }
        set { locationCode = value; }
Then assuming you had some page that inherited from the page above, you could pass the value of the LocationCode via compiler directive
<%@ Page Language="C#" LocationCode="LAX" Inherits="LocalBasePage" %>
This is kind of a neat new feature in that it allows yet another way to pass values into a base page.
There are a number of starter kits available for download now on MSDN.  These starter kits help you get started creating various different types of software or web sites.  Starter kits for software now available include, Shareware, Web Log Analyzer, Card Game, and Amazon-Enabled Movie Collection.  There are also some web site starter kits available including Personal Website, Time Tracker, Club Website, and the Sample Access Provider starter kit.  These starter kits have some useuful code and can provide to be a good learning experience. 
You can download them here:
The provider model introduces in ASP.NET 2.0 is a great new design pattern that allows you to abstract out Membership, Roles, and Personalization.  Microsoft is making the entire provider model open source.  We will be able to take existing providers (i.e.: SQL Server) and customize them to our own tables or some other backend (i.e.: BlueChip).
IE7 Beta 1 will not have crap fixed that developers care about.  This blog entry discusses several of the things that will be fixed in Beta 2.  Kevin you should be happy they finally have Alpha channels in PNG images.
LongHorn seemed to work ok for a beta, but it certainly had a number of issues.  The most annoying being that when it went into power saving mode, my USB Mouse would not function until I unplugged and replugged.  Then as I mentioned my Audio drivers would not work.  Lastly, the reason I uninstalled is that I wanted to reencode some movies with Nero Recode and it would crash. 
On a side note, the new event log is pretty kick ass.  It is multipaned and allows you to see more details about the error without popping up a modal dialog.  Events also appear to be stored in XML now.
More Posts « Previous page