Archive for November, 2007
VS 2005 Extension WCF,WPF and WF Installation Problem
For example, you have C:\Download\Visual Studio 2005 Extensions for Windows Workflow Foundation (EN).exe C:\Download\Setup.exe The Setup.exe will be activated somehow if you run the installer of the extension. Try to place the installer file in a new folder which does not contain any setup.exe
WSE UsernameToken Password SendHashed – Crack
Using ServiceCapture, Ethereal, Charles or some SOAP sniffer software to inspect the XML sent on wire. Here is XML snippet in the SOAP header. <wsse:usernametoken wsu:id=”….” xmlns:wsu=”….”> <wsse:username>xxxxxx</wsse:username> <wsse:password type=”….”> fCQCp/A9wFD/Gku0L+yF/u+0leg= </wsse:password> <wsse:nonce>eSM7S/iT0KyA39vuWPQcPQ==</wsse:nonce> <wsu:created>1975-12-01T05:28:36Z</wsu:created> </wsse:usernametoken> [STAThread] static void Main() { [...]
SQL 2005 generates XML comment, array of elements
SELECT ‘nameValue’ AS “@name”, CAST(’<!– your comment –>’ AS XML), ‘anotherValue’ AS “another”, (SELECT ‘i’ AS “@name”, ’1′ AS “@value” FOR XML PATH(’item’), TYPE), (SELECT ‘j’ AS “@name”, ’2′ AS “@value” FOR XML PATH(’item’), TYPE) [...]
XML Elements or Attributes in the world
Elements way is good at interoperability. Attributes way is good at size of the XML. <message> <id>1</id> <myword>Hello</myword> </message> <message id=”1″> <myword>Hello</myword> </message> <message id=”1″>Hello</message> <message id=”1″ myword=”Hello” /> Which way do you prefer?
C# Watch file system
using System.IO; public static void WatchFolder() { FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(); fileSystemWatcher .Path = “C:\\FoldName”; fileSystemWatcher .NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName; fileSystemWatcher .Filter = “*.cs”; // Add an event [...]
C# Single WinApp instance
using System.Threading; static void Main() { bool isFirstInstance; Mutex mutex = new Mutex(true, “Global\\” + “App_Name_Hereâ€, out isFirstInstance); if(isFirstInstance) Application.Run(new YourAppMainClass()); else MessageBox.Show(”There is already an instance running.”, “Warning”, MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Buttonx); }