April 2004 - Posts
void MyGrid_Edit(object sender, DataGridCommandEventArgs e) {
MyGrid.EditItemIndex = e.Item.ItemIndex;
BindMyGrid();
DataGridItem line = MyGrid.Items[e.Item.ItemIndex];
TextBox tb1 = (TextBox)line.Cells[0].Controls[0];
TextBox tb2 = (TextBox)line.Cells[1].Controls[0];
tb1.Width = Unit.Percentage(100);
tb2.Width = Unit.Percentage(100);
tb2.TextMode = TextBoxMode.MultiLine;
}
refer: http://www.atmarkit.co.jp/fdotnet/dotnettips/082wideedit/wideedit.html
When encrypting a stream with System.Security.DesCryptoServiceProvider, code sniipt like the following.
Byte []EncryedText=Convert.FromBase64String(this.textBox3.Text) ;
System.IO.MemoryStream EncryptedStream=new System.IO.MemoryStream(EncryedText);
System.IO.MemoryStream OutMS=new System.IO.MemoryStream();
EncryptedStream.Seek(0,System.IO.SeekOrigin.Begin);
System.Security.Cryptography.DESCryptoServiceProvider x_des=new DESCryptoServiceProvider();
//??
x_des.IV=m_IV;
x_des.Key=m_Key;
//???
System.Security.Cryptography.CryptoStream encryptStream =new CryptoStream(OutMS,x_des.CreateDecryptor(),System.Security.Cryptography.CryptoStreamMode.Write);
encryptStream.Write(EncryedText,0,EncryedText.Length);
encryptStream.FlushFinalBlock();
Byte[] outText=new byte[(Int32)OutMS.Length];
OutMS.Seek(0,System.IO.SeekOrigin.Begin);
//???????
OutMS.Read(outText,0,(Int32)OutMS.Length);
MessageBox.Show(System.Text.Encoding.Unicode.GetString(outText));
if the FlushFinalBlock is missed, you probably will not get the full encrypted text
byte[] pk = cer.GetPublicKey();
byte[] m = new byte[pk.Length - 3];
Buffer.BlockCopy(pk, 0, m, 0, m.Length);
byte[] e = new byte[3];
Buffer.BlockCopy(pk, m.Length, e, 0, 3);
String key = "<RSAKeyValue><Modulus>" + Convert.ToBase64String(m)+"</Modulus><Exponent>"+Convert.ToBase64String(e)+"</Exponent></RSAKeyValue>";
Console.WriteLine(key);
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
rsa.FromXmlString(key);
Console.WriteLine(rsa.ToXmlString(false));
SQLXML 3.0 extends the built-in XML capabilities of SQL Server 2000 with technology to create XML Web services from SQL Server stored procedures or server-side XML templates. SQLXML 3.0 also includes extensions to the .NET Framework that provide SQLXML programmability to the languages supported by Microsoft® Visual Studio® .NET, including C# and Microsoft Visual Basic® .NET.
System Requirements
The Web Services toolkit download doesn't include the Webcasts; please download them separately.
SQLXML 3.0 is optimized for use with Visual Studio .NET.
This release is installed using the Microsoft Windows® Installer 2.0. You might need to upgrade your installer to Windows Installer 2.0 prior to installing SQLXML 3.0.
Additionally, users might need to install the Microsoft SOAP Toolkit 2.0
Aim: I wanna guarantee that only signed assembly have the access to my class library. SO I make use of the .net StrongNameIdentityPermissionAttribute to protect my assembly. When testing ,I encounter the different public keys of a same public/private key pair.
1. Extract the public key from the keyfile
Sn -tp montaque.snk
the public key echos:
Public key is
0702000000240000525341320004000001000100eb3a0ffb39f8d13e553d77c40399287cb7f29e
d6199da3daa9a31db7c437e0c550bae8e4bad69b7aad37ff9acc541166256d384176fe22ae6b1a
0f5204c8c8a5ba7c8f796506fb9f4621db157830e3faef0652a89ea30c3fe53b45033c7466a3ed
a68d8d40b4909d03e91c6f72d43f1740c10d701e74c500b8c9f491c11ae2b90fd7494f824a7ebb
f40a2aefc8886b8f7396ef3d0e5bf2d78c66db8b69a36fdc6ed378171d5837c43c871d0ce7c47b
61b53c36234f600072e8dfa17c13814eec657eac534c8fcd5291721f702e9b4e7d1b6c995af685
6018e624a4435eb3d4681f83c636e374d8cf7ec38829f0b68071ed7fdf2dc243b87aa62e1d8fcd
d65fc9773c297f59d46d270e7ffadcb457abf1ed7a73734d17e41564a223703085318bb81b21ba
6e1724dbb32b4e79f10fc407ef835429014fe1e34b7c8e07316b5064757c47a1daba35cd3f9d53
ee99f6ee7c0a8a5e6c7ac7e56173b9a8e02a02b301a5415dfe2089e827ae372e4a5b65058a892d
b654669485ea9e6238f5b4a69195d58cb345586c781e0f50a23fe67c6fdd7c766f867fed718bd4
98e8cd95dbcad5e48f0ebef977c779c71329aa6ab5c1c6596a7b8fb0df0c24ff05d967e2fa97e8
c9e0844074b7b7bc6f45fa86d4b55cd09c3bcab03f28670e5d9fa9ad1383eeb1bbe201e290b38d
18195d867ee066f10dd9277eaf60d45c737cbb301a955c88bf60b203e8b0ac13a887c0003d5d45
131c6a88a8c59a094ea69fa0440b4f78fe8bb5fa1b8957ae6ae9c9671e02b08cec48b42023d2d1
7c5ef152596caa2a890027
Public key token is 7a2a95f64f29bc4f
the key length is 1192
2. extract the public key of the signed assembly.
Public key is
0024000004800000940000000602000000240000525341310004000001000100eb3a0ffb39f8d1
3e553d77c40399287cb7f29ed6199da3daa9a31db7c437e0c550bae8e4bad69b7aad37ff9acc54
1166256d384176fe22ae6b1a0f5204c8c8a5ba7c8f796506fb9f4621db157830e3faef0652a89e
a30c3fe53b45033c7466a3eda68d8d40b4909d03e91c6f72d43f1740c10d701e74c500b8c9f491
c11ae2b9
Public key token is 9bcbe75a245746b6
I am suprised that why two keys are not equal, does they have some relationship like mapping or hashing?
sn -Tp mysignedassembly.dll
MSMQ is the well-known Message API for windows developers. You can use MSMQ API directly by using System.Messaging class. Sometimes user needs to use IBM MQSeries especially for mainframe developers. IBM is providing a set of APIs Dotnet support pack using this we can access MQSeries. In this article I will explain the way to get and put messages using MQSeries and also will show the way to identify a particular message in queue of messages.
First of all we need to install the MQSeries Server in Windows 2000 server and need to install the MQSeries Client and Dotnet support pack in the client machine. Then we need to create QueueManager, Queue and Channel in MQSeries Server.
The Authorization and Profile Application Block is a reusable code component that builds on the capabilities of the Microsoft .NET Framework to help you perform authorization and access profile information.
The Authorization and Profile Application Block provides you with an infrastructure for role-based authorization and access to profile information. The block allows you to:
? Authorize a user of an application or system.
? Use multiple authorization storage providers.
? Plug in business rules for action validation.
? Map multiple identities to a single user.
? Access profile information that can be stored in multiple profile stores.
Download: http://www.microsoft.com/downloads/details.aspx?familyid=ba983ad5-e74f-4be9-b146-9d2d2c6f8e81&displaylang=en
What is the Indexing Service?
Microsoft Indexing Service is a service that provides a means of quickly searching for files on the machine. The most familiar usage of the service is on web servers, where it provides the functionality behind site searches. It is built into Windows 2000 and 2003. It provides a straightforward way to index and search your web site.
Setting up the Indexing Service is explained at windowswebsolutions.com and will not be covered here.
Connecting to the Indexing Service
The Indexing Service exposes itself to the developer as as ADO.Net provider MSIDXS with the data source equal to the indexing catalog name. For example, the connection string used in searching this site is
Provider="MSIDXS";Data Source="idunno.org";
As with any other ADO.Net provider you use the connection string property of the System.Data.OleDb.OleDbConnection object.
using System.Data.OleDb;
protected OleDbConnection odbSearch;
odbSearch.ConnectionString =
"Provider= \"MSIDXS\";Data Source=\"idunno.org\";";
odbSearch.Open();
// Query and process results
odbSearch.Close();
You can also use the connection string in Visual Studio by dragging and dropping an OleDbConnection onto your asp.net page and setting the ConnectionString property in the Properties tab.
refer: http://idunno.org/dotNet/indexserver.aspx