<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://dotnetslackers.com/Community/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Bashar Kokash&amp;#39; Blog - All Comments</title><link>http://dotnetslackers.com/Community/blogs/basharkokash/default.aspx</link><description>.Net Framework, windows and web development.</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 SP1 (Build: 30415.43)</generator><item><title>re: USB Port Insert / Remove detection using WMI (Source Code)</title><link>http://dotnetslackers.com/Community/blogs/basharkokash/archive/2008/03/15/USB-Detection-source-code.aspx#32313</link><pubDate>Wed, 16 Sep 2009 10:58:31 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:32313</guid><dc:creator>Jan Vergel</dc:creator><description>&lt;p&gt;Hello Sir,&lt;/p&gt;
&lt;p&gt;Just like to ask if its possible to know the information about the ejected/inserted usb. What is its com port number used.etc&lt;/p&gt;
&lt;p&gt;Just wanted to know if I unplugged a usb. &lt;/p&gt;
&lt;p&gt;I want to popup a message saying&lt;/p&gt;
&lt;p&gt;&amp;quot;USB Serial (COM4)&amp;quot; was unplugged.&lt;/p&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;p&gt;&amp;quot;USB Serial (COM4)&amp;quot; was plugged.&lt;/p&gt;
&lt;p&gt;thanks..&lt;/p&gt;
&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=32313" width="1" height="1"&gt;</description></item><item><title>DigitalFeed.Info  &amp;raquo; Blog Archive   &amp;raquo; ICT Security forum 2009 summary</title><link>http://dotnetslackers.com/Community/blogs/basharkokash/archive/2009/07/30/ict-security-forum-2009-summary.aspx#31799</link><pubDate>Wed, 29 Jul 2009 22:34:14 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:31799</guid><dc:creator>DigitalFeed.Info  » Blog Archive   » ICT Security forum 2009 summary</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;DigitalFeed.Info &amp;nbsp;&amp;raquo; Blog Archive &amp;nbsp; &amp;raquo; ICT Security forum 2009 summary&lt;/p&gt;
&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=31799" width="1" height="1"&gt;</description></item><item><title>ICT Security forum 2009 summary &amp;laquo;  Percuma Untuk Anda</title><link>http://dotnetslackers.com/Community/blogs/basharkokash/archive/2009/07/30/ict-security-forum-2009-summary.aspx#31798</link><pubDate>Wed, 29 Jul 2009 21:27:40 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:31798</guid><dc:creator>ICT Security forum 2009 summary «  Percuma Untuk Anda</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;ICT Security forum 2009 summary &amp;laquo; &amp;nbsp;Percuma Untuk Anda&lt;/p&gt;
&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=31798" width="1" height="1"&gt;</description></item><item><title>re: USB Port Insert / Remove detection using WMI (Source Code)</title><link>http://dotnetslackers.com/Community/blogs/basharkokash/archive/2008/03/15/USB-Detection-source-code.aspx#29986</link><pubDate>Tue, 18 Nov 2008 09:24:18 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29986</guid><dc:creator>qasali</dc:creator><description>&lt;p&gt;I have tried the above mentioned code with one modification. As My PC is on the domain and I am the network administrator so I Have added ConnectionOptions in ManagementScope constructor&lt;/p&gt;
&lt;p&gt;The modified code is &lt;/p&gt;
&lt;p&gt;ConnectionOptions options = new ConnectionOptions(&amp;quot;MS_409&amp;quot;, &amp;quot;Administrator&amp;quot;, &amp;quot;pdfd0tc0mpk123&amp;quot;,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;ntdlmdomain:PDF&amp;quot;,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.Management.ImpersonationLevel.Impersonate,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.Management.AuthenticationLevel.Default, true,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;null, System.TimeSpan.MaxValue);&lt;/p&gt;
&lt;p&gt;and used in ManagementScope as &lt;/p&gt;
&lt;p&gt;ManagementScope scope = new ManagementScope(&amp;quot;root\\CIMV2&amp;quot;,options);&lt;/p&gt;
&lt;p&gt;but it gives runtime error of INVALID PARAMETER&lt;/p&gt;
&lt;p&gt;at following lines&lt;/p&gt;
&lt;p&gt;w.Start() of both &lt;/p&gt;
&lt;p&gt;public static void AddRemoveUSBHandler()&lt;/p&gt;
&lt;p&gt;public static void AddInsetUSBHandler() &lt;/p&gt;
&lt;p&gt;What is the problem and solution&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29986" width="1" height="1"&gt;</description></item><item><title>cerebral ataxia</title><link>http://dotnetslackers.com/Community/blogs/basharkokash/archive/2008/06/07/how-to-implement-your-own-aggregate-function-in-sqlclr-sql-server-2005.aspx#28770</link><pubDate>Sat, 30 Aug 2008 19:18:08 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:28770</guid><dc:creator>cerebral ataxia</dc:creator><description>&lt;p&gt;Meta: Login RSS Comments RSS Valid XHTML XFN WP January 31, 2008 Psychology,psychiatric, Autism, Crossing the Cruel Wires of Truth. Filed under: Autism Research spotlight— blog@ 7:&lt;/p&gt;
&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=28770" width="1" height="1"&gt;</description></item><item><title>for loops in sql</title><link>http://dotnetslackers.com/Community/blogs/basharkokash/archive/2008/06/04/sql-clr-overview.aspx#27452</link><pubDate>Mon, 30 Jun 2008 04:38:21 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:27452</guid><dc:creator>for loops in sql</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;for loops in sql&lt;/p&gt;
&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=27452" width="1" height="1"&gt;</description></item><item><title>Measuring SQLCR Performance using SQL Server Profiler</title><link>http://dotnetslackers.com/Community/blogs/basharkokash/archive/2008/06/07/how-to-implement-your-own-aggregate-function-in-sqlclr-sql-server-2005.aspx#27138</link><pubDate>Mon, 09 Jun 2008 09:52:58 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:27138</guid><dc:creator>Bashar Kokash' Blog</dc:creator><description>&lt;p&gt;Recently, I&amp;#39;ve been doing a lot of invoking .NET Assemblies within SQL Server 2005, I bloged an overview&lt;/p&gt;
&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=27138" width="1" height="1"&gt;</description></item><item><title>Measuring SQLCR Performance using SQL Server Profiler</title><link>http://dotnetslackers.com/Community/blogs/basharkokash/archive/2008/06/04/sql-clr-overview.aspx#27137</link><pubDate>Mon, 09 Jun 2008 09:52:54 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:27137</guid><dc:creator>Bashar Kokash' Blog</dc:creator><description>&lt;p&gt;Recently, I&amp;#39;ve been doing a lot of invoking .NET Assemblies within SQL Server 2005, I bloged an overview&lt;/p&gt;
&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=27137" width="1" height="1"&gt;</description></item><item><title>How to implement your own aggregate function in SQLCLR, SQL Server 2005</title><link>http://dotnetslackers.com/Community/blogs/basharkokash/archive/2008/06/04/sql-clr-overview.aspx#27121</link><pubDate>Sat, 07 Jun 2008 09:35:56 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:27121</guid><dc:creator>Bashar Kokash' Blog</dc:creator><description>&lt;p&gt;I posted earlier an overview about the SQLCLR component of the SQL Server 2005, and showed how to implement&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=27121" width="1" height="1"&gt;</description></item><item><title>re: SQL CLR overview</title><link>http://dotnetslackers.com/Community/blogs/basharkokash/archive/2008/06/04/sql-clr-overview.aspx#27082</link><pubDate>Thu, 05 Jun 2008 18:38:20 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:27082</guid><dc:creator>Nico</dc:creator><description>&lt;p&gt;It definitely makes admins more efficient to be able to use stored procedures, I just hope they are using best practices in creating SQL statements (eg., not concatenating statements). &amp;nbsp;But I guess that&amp;#39;s a whole &amp;#39;nother story. &amp;nbsp;CLR remains an immensely useful toolset, no matter what you&amp;#39;re doing with it. :)&lt;/p&gt;
&lt;p&gt;**************&lt;/p&gt;
&lt;p&gt;Nico del Castillo&lt;/p&gt;
&lt;p&gt;Microsoft Security Outreach Team&lt;/p&gt;
&lt;p&gt;www.microsoft.com/hellosecureworld7&lt;/p&gt;
&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=27082" width="1" height="1"&gt;</description></item><item><title>re: USB Port Insert / Remove detection using WMI</title><link>http://dotnetslackers.com/Community/blogs/basharkokash/archive/2008/02/06/usb-port-insert-remove-detection-using-wmi.aspx#25607</link><pubDate>Sat, 15 Mar 2008 09:28:32 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:25607</guid><dc:creator>BasharKokash</dc:creator><description>&lt;p&gt;Here is a simple sourcecode: &lt;a rel="nofollow" target="_new" href="http://dotnetslackers.com/community/blogs/basharkokash/archive/2008/03/15/USB-Detection-source-code.aspx"&gt;dotnetslackers.com/.../USB-Detection-source-code.aspx&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=25607" width="1" height="1"&gt;</description></item><item><title>re: USB Port Insert / Remove detection using WMI</title><link>http://dotnetslackers.com/Community/blogs/basharkokash/archive/2008/02/06/usb-port-insert-remove-detection-using-wmi.aspx#21450</link><pubDate>Fri, 29 Feb 2008 09:45:14 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:21450</guid><dc:creator>Geoffrey</dc:creator><description>&lt;p&gt;how to do this two&lt;/p&gt;
&lt;p&gt;InstanceCreationEvent&lt;/p&gt;
&lt;p&gt;InstanceDeletionEvent?&lt;/p&gt;
&lt;p&gt;can u provide full source code?&lt;/p&gt;
&lt;p&gt;do u mind to send to my mail?&lt;/p&gt;
&lt;p&gt;wensan312@yahoo.com&lt;/p&gt;
&lt;p&gt;need your help.thanks.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=21450" width="1" height="1"&gt;</description></item><item><title>re: Uploading files in ASP.NET</title><link>http://dotnetslackers.com/Community/blogs/basharkokash/archive/2007/09/11/Test.aspx#17205</link><pubDate>Tue, 12 Feb 2008 05:59:56 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:17205</guid><dc:creator>mikael</dc:creator><description>&lt;p&gt;Thanks man!!! This is quite enlightening. More power guys!!!You rock people!&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=17205" width="1" height="1"&gt;</description></item><item><title>re: Convert an image to gray scale</title><link>http://dotnetslackers.com/Community/blogs/basharkokash/archive/2007/09/24/convert-an-image-to-gray-scale.aspx#11250</link><pubDate>Sat, 22 Dec 2007 17:52:01 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:11250</guid><dc:creator>BasharKokash</dc:creator><description>&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;That's why I post may code, in order to learn from others.&lt;/p&gt;
&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=11250" width="1" height="1"&gt;</description></item><item><title>re: Convert an image to gray scale</title><link>http://dotnetslackers.com/Community/blogs/basharkokash/archive/2007/09/24/convert-an-image-to-gray-scale.aspx#9918</link><pubDate>Tue, 18 Dec 2007 06:46:18 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:9918</guid><dc:creator>Phil</dc:creator><description>&lt;p&gt;Here&amp;#39;s an even better (and faster) way:&lt;/p&gt;
&lt;p&gt;public static Bitmap ConvertImageToGrayscale(System.Drawing.Image original)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;	// create a blank bitmap the same size as original&lt;/p&gt;
&lt;p&gt;	Bitmap newBitmap = new Bitmap(original.Width, original.Height);&lt;/p&gt;
&lt;p&gt;	// get a graphics object from the new image&lt;/p&gt;
&lt;p&gt;	Graphics g = Graphics.FromImage(newBitmap);&lt;/p&gt;
&lt;p&gt;	// create the grayscale ColorMatrix&lt;/p&gt;
&lt;p&gt;	ColorMatrix colorMatrix = new ColorMatrix(new float[][] &lt;/p&gt;
&lt;p&gt;		 &amp;nbsp;{&lt;/p&gt;
&lt;p&gt;			 new float[] {.3f, .3f, .3f, 0, 0},&lt;/p&gt;
&lt;p&gt;			 new float[] {.59f, .59f, .59f, 0, 0},&lt;/p&gt;
&lt;p&gt;			 new float[] {.11f, .11f, .11f, 0, 0},&lt;/p&gt;
&lt;p&gt;			 new float[] {0, 0, 0, 1, 0},&lt;/p&gt;
&lt;p&gt;			 new float[] {0, 0, 0, 0, 1}&lt;/p&gt;
&lt;p&gt;		 &amp;nbsp;});&lt;/p&gt;
&lt;p&gt;	// create some image attributes&lt;/p&gt;
&lt;p&gt;	ImageAttributes attributes = new ImageAttributes();&lt;/p&gt;
&lt;p&gt;	// set the color matrix attribute&lt;/p&gt;
&lt;p&gt;	attributes.SetColorMatrix(colorMatrix);&lt;/p&gt;
&lt;p&gt;	// draw the original image on the new image using the grayscale color matrix&lt;/p&gt;
&lt;p&gt;	g.DrawImage(original, new Rectangle(0, 0, original.Width, original.Height), 0, 0, original.Width, original.Height, GraphicsUnit.Pixel, attributes);&lt;/p&gt;
&lt;p&gt;	// dispose the Graphics object&lt;/p&gt;
&lt;p&gt;	g.Dispose();&lt;/p&gt;
&lt;p&gt;	return newBitmap;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=9918" width="1" height="1"&gt;</description></item></channel></rss>