A Straight Forward ASP.NET AJAX Solution With MS Ajax, Restful WCF Services, and A Dash Of JQuery

One of the main advantages of JSON is that, like XML, it can represent an object graph of any shape.  JSON allows for the natural structure of entity Types to be expressed in the form of nested and aggregated object literals.  The simplicity and small footprint of this format has made it a popular choiceContinue reading “A Straight Forward ASP.NET AJAX Solution With MS Ajax, Restful WCF Services, and A Dash Of JQuery”

Get Control Of Your Enterprise Library Logging Application Block Logs

Enterprise Library’s Logger is powerful and convenient.  It’s default TextFormatter provides a suitable human readable format, and it also allows you to implement custom formatters to suite your needs.  I think that being able to work with log data without having to manually parse strings, can really simplify the development of tools for mining logs.   To this end,Continue reading “Get Control Of Your Enterprise Library Logging Application Block Logs”

Object Bakery – Fun with .NET Serialization and Crypto: Part 2

In my last article, I demonstrated how to use .NET serialization to dehydrate and rehydrate objects with helpers that drive XmlSerializer, DataContractSerializer, SoapFormatter, and BinaryFormatter.  This is part 2, where I expand upon these concepts demonstrating how to use the DESCryptoServiceProvider to securely save off your objects for later consumption.   For this, I created a fewContinue reading “Object Bakery – Fun with .NET Serialization and Crypto: Part 2”

Object Bakery – Fun with .NET Serialization and Crypto: Part 1

Being able to snapshot an object graph at runtime can be a valuable capability.  I have had occasion to capture objects during a run for the purpose of analyzing and debugging problems that require comparison across multiple runs.  Additionally, the power to dehydrate objects and store them in a disk based cache, can also proveContinue reading “Object Bakery – Fun with .NET Serialization and Crypto: Part 1”

Symmetric Hashing With .NET Crypto Service Providers and COM Interop

I wrote the DotNetCryptoCOM (DNCC) library because I  wanted to be able to generate and reverse cypher text between .NET and COM applications using a single .dll.  It allows developers to drive the builtin .NET Cryptographic Service Providers with a simple API.  I’ve used this lib in VB, Managed C++, and of course C# applications.  Some ofContinue reading “Symmetric Hashing With .NET Crypto Service Providers and COM Interop”

A config-based approach to pluggable composition

I wanted to share this sample to demonstrate a simple way to implement a configuration based approach to switching out pluggable dependencies.  The example here uses reflection to dynamically load an assembly and then instantiate the targeted class contained therein.  The idea with this approach is that you may have different implementations of an interface containedContinue reading “A config-based approach to pluggable composition”

Simple Random Password Generator

  Simple C# function to generate random passwords:   Random randomizer = new Random(); public string CreateTemporaryPassword(int length) {     string letters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";     var chars = new char[length];     for (int i = 0; i < length; i++)         chars[i] = letters[randomizer.Next(0, letters.Length)];     return new string(chars); }

TSQL function to parse delimeted string and return a memory table containing the values

This script is useful when you need to generate a rowset from a delimeted string.  It allows the "WHERE IN" clause to be used against the values in the string, because they are converted into table rows.  This UDF is designed to be plugged into other queries where this need is present.  Here’s an example ofContinue reading “TSQL function to parse delimeted string and return a memory table containing the values”

AutoFocus the UserName field of an ASP.NET Login Control

Even if you’re not using a templated version of the Login Control, the builtin TextBox for username entry can be targeted like this: protected void Page_Load(object sender, EventArgs e){            SetFocus(Login1.FindControl("UserName")); }  SetFocus is in the Page class. Easy joy..

Demonstration of Dynamic Type Creation and Resolution

This is a modified sample from the .NET Framework SDK.  Basically demonstrates how to programmatically drive the ILGenerator to emit code resulting in a method definition.  Note that it is wrapped in a programmatically created assembly that exists only in memory.  In the Main of this Application, the dynamic assembly is unwrapped and reflection isContinue reading “Demonstration of Dynamic Type Creation and Resolution”