April 30th, 2008
There is another pseudo-register useful when working with C# language:
$exception
It contains last exception that is thrown by an application.
Suppose that we have code like this:
C#:
try
{
// something
}
catch
{
// do something else
}
with $exception pseudo-register you can easily examine it:

April 12th, 2008
I found a very interesting feature of Visual Studio's debugger. It's been there for a long time but many developers do not know (including me) that pseudo-registers can be helpful.
There are more registers but I will mention just two of them.
@ERR
Well, it returns the same as GetLastError(), It optionally can return formatted string - just write it like @err,hr
I think I don't need to add more, screens below are self-explanatory


$user
Provides many informations about a user executing current process

Happy debugging.
April 12th, 2008
Did you know where the C# name come from? I didn't 
According to wikipedia: "The name "C sharp" was inspired from musical notation where a sharp indicates that the written note should be made a half-step higher in pitch".
Stupid 
February 19th, 2008
I have written another tiny tool which helps me in every-day work.
Look at the projects page.
January 31st, 2008
Sometimes a programmer must do very weird things in his ASP.NET webapp. Among them, there is a postback initiated in custom javascript. Before .NET Framework 2.0, it was no good solution to achieve it. Fortunately it can be done without much effort nowadays.
There is an interface called IPostBackEventHandler which must be implemented by a page or a control. Then you must create javascript containing reference to postback function retrieved by ClientScriptManager.GetPostBackEventReference(...) method.
The sample web control's codebehind can look like below:
C#:
public class MyControl : Control, IPostBackEventHandler
{
// this method will be called on postback initiated in javascript
public void RaisePostBackEvent(string eventArgument)
{
if (eventArgument == "foo")
{
// do something
}
}
}
then we create javascript in aspx / ascx file:
ASP:
<script>
function Test()
{
<%= Page.ClientScript.GetPostBackEventReference(this, "foo"); %>
}
</script>
Now, when a Test() function is called in a browser, our page will do a nice, clean postback 