html5 websocket api data framing in c#
Posted on | October 18, 2011 | No Comments
working on the latest html5 websocket api and developing a html5 websocket server in c#. i spent some time on processing the data frame passed in from the browser in c#. just share it here so someone else might save some time and also might give some thoughts to improve it.
some background.
- the latest Websocket IETF draft is draft 17 http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17 (websocket version 8 )
- the draft you can play with is draft 10 http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10 (websocket version 8 ) which is build in browser: chrome 14, firefox 7 and IE10 developer preview.
Block IP address or IP range in windows server 2008 by Windows Firewall
Posted on | October 4, 2011 | 1 Comment
NameValueCollection VS Dictionary
Posted on | January 6, 2011 | No Comments
You are considering the NameValueCollection type in the C# programming language. This collection is found in System.Collections.Specialized, and provides a way to map one key to multiple values without custom code. Here we see several examples on NameValueCollection, and then go further and review its use in ASP.NET and benchmark it.
=== NameValueCollection benchmark ===
NameValueCollection lookup: 2768 ms
Dictionary lookup: 407 ms [faster]
Using NameValueCollection
First, we see how you can create a new NameValueCollection. The example then adds four key/value pairs to the collection. The keys can occur more than once, but map to the same array of values. This means you can have one key pointing to two values.
=== Program that uses NameValueCollection (C#) ===
using System;
using System.Collections.Specialized;
class Program
{
static NameValueCollection GetCollection()
{
NameValueCollection collection = new NameValueCollection();
collection.Add(“Sam”, “Dot Net Perls”);
collection.Add(“Bill”, “Microsoft”);
collection.Add(“Bill”, “White House”);
collection.Add(“Sam”, “IBM”);
return collection;
}
Read more
get URL, query string ect.
Posted on | January 5, 2011 | No Comments
string url = HttpContext.Current.Request.Url.AbsoluteUri;
// http://localhost:1302/TESTERS/Default6.aspx
string path = HttpContext.Current.Request.Url.AbsolutePath;
// /TESTERS/Default6.aspx
string host = HttpContext.Current.Request.Url.Host;
// localhost
//get the the complete querystring part
Uri tempUri = new Uri("http://www.studyblog.net/Default.aspx?fname=kai&lname=dong");
string sQuery = tempUri.Query;
//The 'sQuery' variable would now contain '?fname=kai&lname=dong', which is our query string from the absolut path i did put into my uri object.
//then you can use HttpUtility.ParseQueryString to put all querystring fields into NameValueCollection
string FName = HttpUtility.ParseQueryString(sQuery).Get("fname");
Load SCSI hard drive driver without floppy disk while Install windows server 2003 etc.
Posted on | December 23, 2010 | No Comments
while playing with my new toy, a very old HP ProLiant DL360 G4 / G4p, i need to load the scsi hard driver by press F6 while installing windows server 2003, then insert the floppy disk, because the HP ProLiant DL360
G4 uses SCSI U320 hand drive and the scsi driver is not included in Windows server 2003……. -_-!
i dun even remember there’s a thing called Floppy Disk or Diskettes… anyway, i need to work around this.
after a bit search, i found the following solution:
basicly this solution integrate the scsi hard drive driver into your Windows Server installation disk.
- you’ll need 1 extra software, free of cause.
- and the scsi driver of cause…
windows server 2003 Serial Number
Posted on | December 20, 2010 | No Comments
Windows Server 2003 Serial Number
WIN2003 Serial Number
all collected from internet
JCDPY-8M2V9-BR862-KH9XB-HJ3HM
JCBPD-YMX9T-G34HP-PTDWM-CDBQY
JB94R-RDRMF-BR67T-Q8RX6-2MDHM
JCBP6-9D7HT-HGBGB-HMB39-4QGBB
JCGTT-VF8FF-4DQCX-KVBBH-2QKVM

