Happy New Year!
To everyone that reads my blog, Happy New Year!
Random thoughts about .Net development
To everyone that reads my blog, Happy New Year!
The simple trick shows how to read rss feed into DataSet .
using System;
using System.Data;
using System.Net;
namespace DevIntelligence.Examples
{
class RssReader
{
[STAThread]
static void Main(string[] args)
{
HttpWebRequest feed =
HttpWebRequest.Create("http://msdn.microsoft.com/rss.xml")
as HttpWebRequest;
DataSet data = new DataSet();
data.ReadXml( feed.GetResponse().GetResponseStream()) ;
}
}
}
This article presents an approach of creating and managing multiple sites on the Windows XP IIS.
The SQL Server 2005 System Table Map shows the system tables integrated in SQL Server 2005, and the relations between them.
The following code sample demonstrates how to calculate a request signature to sign authenticated requests to AWS.
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace Devintelligence.Aws
{
/// <summary>
/// Generation authentication signatures for AWS Platform requests.
/// </summary>
public class AwsUtils
{
/// <summary>
/// Computes RFC 2104-compliant HMAC signature.
/// </summary>
/// <param name="data">The data to be signed.</param>
/// <param name="key">The signing key.</param>
/// <returns>The Base64-encoded RFC 2104-compliant HMAC signature.</returns>
public static string calculateRFC2104HMAC(string data, string key)
{
byte[] bData = Encoding.UTF8.GetBytes(data);
byte[] bKey = Encoding.UTF8.GetBytes(key);
HMACSHA1 hmac = new HMACSHA1(bKey);
using(CryptoStream cryptoStream =
new CryptoStream(Stream.Null, hmac, CryptoStreamMode.Write) )
{
cryptoStream.Write(bData, 0, bData.Length);
}
return Convert.ToBase64String(hmac.Hash);
}
/// <summary>
/// Gets the time stamp.
/// </summary>
/// <param name="dateTime">Date time.</param>
/// <returns></returns>
public static string GetTimeStamp(DateTime dateTime)
{
return dateTime.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffZ");
}
}
}