hardcodedblog.blogspot.com
HardCodeD: (Ab)using Registry classes in .NET
http://hardcodedblog.blogspot.com/2009/06/do-not-try-this-at-home.html
This is where I get to teach code. Ab)using Registry classes in .NET. The NET Framework provides wonderful classes in the Microsoft.Win32 namespace. To read and write values to any key or set of keys in the Windows Registry. And in fact there's so much else to do with the Registry! Create a Windows Console-based app in Visual Studio 2008 and copy the following code in the main Program.cs. WriteLine( "WELCOME TO NASTY APPLICATION". WriteLine( " nThis application will do the following:". CurrentUser.Cr...
hardcodedblog.blogspot.com
HardCodeD: Classes for files and folders in C#
http://hardcodedblog.blogspot.com/2009/07/files-and-folders.html
This is where I get to teach code. Classes for files and folders in C#. The NET Framework provides a comprehensive set of base classes to explore the entire file system, finding out files and folders that are present and listing their properties (and a whole lot of them). These base classes expose methods that allow file and folder operations as well, such as moving, copying, deleting and renaming. Here we go through the available classes. The methods of DirectoryInfo. Length = 0;. Although these classes...
hardcodedblog.blogspot.com
HardCodeD: January 2012
http://hardcodedblog.blogspot.com/2012_01_01_archive.html
This is where I get to teach code. Get Web Browser History in C# - Google Chrome. This post is a sort-of sequel to my previous blog post. On getting web browser history in C#. Google Chrome is the browser I had missed in the last blog post and I must say, it was quite interesting to code this up. Just like Firefox, Chrome also uses an SQLite Database, but uses a structure quite different than that of Firefox. More details about it here. As for Firefox, a very nice article is here. Chrome stores time elap...
hardcodedblog.blogspot.com
HardCodeD: December 2009
http://hardcodedblog.blogspot.com/2009_12_01_archive.html
This is where I get to teach code. Visual inheritance in WPF. My final year .NET project was a medium-weight WPF application which had some 8 windows in all. Creating the windows and customizing the interface in XAML was a breeze with Visual Studio 2008. And Expression Blend 2. Even coding up the window logic was not that tough, but halfway into the logic part, I realized that all my windows had some properties and methods in common. So the code could be shortened a great deal using inheritance. Http:/ s...
hardcodedblog.blogspot.com
HardCodeD: January 2010
http://hardcodedblog.blogspot.com/2010_01_01_archive.html
This is where I get to teach code. Using extension methods in C#. One of the most exciting features of the .NET Framework is Extension Methods. Extension methods allow you to extend the functionality of a class without modifying the code of the class itself. This allows you to write methods for a class anywhere outside the class. This is especially useful when there is no access to the code of the original class. For example, you can write a method to extend the System.String. And it would be invoked as:.
hardcodedblog.blogspot.com
HardCodeD: September 2009
http://hardcodedblog.blogspot.com/2009_09_01_archive.html
This is where I get to teach code. Best free addins for Visual Studio 2008. I have subscribed to the Microsoft Download Notifications. Weekly newsletter and it was only yesterday that I clicked something which I had never clicked in any newsletter before - Visual Studio Gallery. It is a list of addins - both free and free trials - for Visual Studio 2008 and if you are a .NET developer, you should not miss this! Likewise. So copying XAML code is an issue. This add-in allows you to manage the MRU (Most Rec...
hardcodedblog.blogspot.com
HardCodeD: July 2009
http://hardcodedblog.blogspot.com/2009_07_01_archive.html
This is where I get to teach code. Everything is a class! It is amazing how often I need to remind my friends with programming doubts that C# is object-oriented - there is no line of code in C# without a reference to a class or an object. There is a class for almost everything in the .NET Framework and its interoperability features make it the platform of choice for Windows applications. Make it simply an uncomfortable language to work with especially for a programmer with C background. Class1 obj = new ...
c-sharpe.blogspot.com
C# and ASP.NET Code: Easy Syntax to Print List Elements
http://c-sharpe.blogspot.com/2009/06/easy-syntax-to-print-list-elements.html
C# and ASP.NET Code. C# and .NET tips and code snippets. Thursday, June 11, 2009. Easy Syntax to Print List. List string myList = new List string { "a", "b", "c", "d"};. A list-printing delegate :. Action string print = elem = { Console.WriteLine(elem);};. January 4, 2010 at 10:00 AM. Thanks for the tip which led me to aanother one. August 26, 2010 at 4:48 PM. This can actually be reduced to a one liner:. MyList.ForEach(x = {Console.WriteLine(x);});. Subscribe to: Post Comments (Atom). Add List to App...
c-sharpe.blogspot.com
C# and ASP.NET Code: December 2014
http://c-sharpe.blogspot.com/2014_12_01_archive.html
C# and ASP.NET Code. C# and .NET tips and code snippets. Monday, December 15, 2014. Editor Template for Boolean Property in Razor. If you want to display 2 radio buttons for a boolean property in Razor with Yes and No labels, this is how you could do it. Create your own editor template and put it in the Shared/EditorTemplate folder. Using System.Web.Mvc. HtmlRadioButtonFor(model= model, false) No. HtmlRadioButtonFor(model = model, true) Yes. Links to this post. Subscribe to: Posts (Atom). Add List to App...
c-sharpe.blogspot.com
C# and ASP.NET Code: Deploy ASP MVC on IIS 6
http://c-sharpe.blogspot.com/2013/09/deploy-asp-mvc-on-iis-6.html
C# and ASP.NET Code. C# and .NET tips and code snippets. Wednesday, September 4, 2013. Deploy ASP MVC on IIS 6. This post just complements information already available online. There are certain steps you need to do first before your ASP MVC application can run in IIS 6. Screen, on the Directory. Tab, click Insert. To insert a wildcard application map:. Browse to the location of the aspnet isapi.dll file. Make sure that Verify that file exists. Subscribe to: Post Comments (Atom). C Razor Sharp .NET.