<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4768571651580285164</id><updated>2012-01-24T05:49:38.416-08:00</updated><category term='TIFF'/><category term='Offset'/><category term='regasm'/><category term='DataGridView'/><category term='control'/><category term='For Each'/><category term='SQL'/><category term='Code Analysis'/><category term='registry'/><category term='Orinates'/><category term='String'/><category term='VB.NET'/><category term='default browser'/><category term='VC++'/><category term='MSI'/><category term='Flicker'/><category term='Syntax Highlighting'/><category term='HTML Help'/><category term='backcolor'/><category term='StreamWriter'/><category term='Form Icon'/><category term='array'/><category term='ASP.NET'/><category term='Append'/><category term='Text'/><category term='Environment'/><category term='ReadLine'/><category term='Visual Studio 2008'/><category term='SQL Like'/><category term='Collections'/><category term='FTP'/><category term='Console'/><category term='SharpDevelop'/><category term='installer'/><category term='Dotfuscator'/><category term='StartPosition'/><category term='KeyCollection'/><category term='file version'/><category term='SplitContainer'/><category term='Forms'/><category term='KnownColor'/><category term='Scaling'/><category term='SolidBrush'/><category term='PInvoke Interop Signatures VB.NET C#'/><category term='Seeking'/><category term='DateTimePicker'/><category term='Dictionary'/><category term='MemoryStream'/><category term='AppStartupPath'/><category term='foreach'/><category term='Fill'/><category term='XML Documentation'/><category term='StreamReader'/><category term='StartupPath'/><category term='TrueType'/><category term='Status Bar'/><category term='KeyValuePair'/><category term='impdp'/><category term='IIS'/><category term='Exit Code'/><category term='selectedindexchanged'/><category term='color selection'/><category term='color dialog'/><category term='Windows Phone 7'/><category term='itemactivate'/><category term='TechEd 2011'/><category term='POOM'/><category term='RGB'/><category term='DateTime'/><category term='XPath'/><category term='Tablespace'/><category term='color'/><category term='CHM'/><category term='auto-increment'/><category term='FXCop'/><category term='selection'/><category term='Compact Framework'/><category term='Internet Explorer'/><category term='Serialization'/><category term='Temp Directory'/><category term='Excel'/><category term='iisreset'/><category term='OpenFileDialog'/><category term='Sorting'/><category term='Windows Mobile'/><category term='MachineName'/><category term='Mango'/><category term='device Id'/><category term='AppSettings'/><category term='listview'/><category term='DllImport'/><category term='Byte Array'/><category term='Native DLL'/><category term='IsNot'/><category term='MessageBox'/><category term='Virtual Earth'/><category term='64bit'/><category term='Nothing'/><category term='Sort By'/><category term='Bitmap'/><category term='Encryption'/><category term='Formatting'/><category term='GetComputerName'/><category term='Oracle'/><category term='OpenFileDialog Thumbnail View Type'/><category term='OraOleDb'/><category term='Version'/><category term='DiffMerge'/><category term='IDisposable'/><category term='TechEd 2008'/><category term='Resources'/><category term='ValueCollection'/><category term='Memory Mapped Files'/><category term='TabControl'/><category term='Array.Clear'/><category term='Escape'/><category term='Rich Text'/><category term='DoEvents'/><category term='Rectangle'/><category term='memset'/><category term='SaveFileDialog'/><category term='Setup Projects'/><category term='code'/><category term='Anchor'/><category term='Option Strict'/><category term='Owner Name'/><category term='Menu'/><category term='launching'/><category term='stylus'/><category term='TechEd 2009'/><category term='Fonts'/><category term='PInvoke'/><category term='iterate'/><category term='RegEx'/><category term='CSV'/><category term='color picker'/><category term='SDO'/><category term='Casting'/><category term='listbox'/><category term='Web Service'/><category term='NUM_ROWS'/><category term='C#'/><category term='Web.Config'/><category term='Device Name'/><category term='FolderBrowsingDialog'/><category term='Process Explorer'/><category term='blogger'/><category term='fit'/><category term='ModifierKeys'/><category term='arrow keys'/><category term='WCF'/><category term='Icon'/><category term='Semi-Transparent Fill'/><category term='Bing Maps'/><category term='OleDb'/><category term='CustomActionData'/><category term='forecolor'/><category term='VB.NET to C#'/><category term='Dock'/><category term='Is'/><category term='Late Binding'/><category term='Large Fonts'/><category term='clipboard'/><category term='C# to VB.NET'/><category term='File Position'/><category term='RegCap.exe'/><title type='text'>.NET Reference</title><subtitle type='html'>This blog is a depository for things I have found regarding VB.NET and C#.NET development (and other things I may need to remember).  This blog is primarily for my own reference, but if the information I found is useful to others, then that is great.  If others want to contribute with comments or other information, then that is great too.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default?start-index=101&amp;max-results=100'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>152</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-2695694207385123326</id><published>2011-11-16T13:32:00.001-08:00</published><updated>2011-11-16T13:35:30.781-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Resources'/><title type='text'>My.Resources in C#</title><content type='html'>The equivalent of:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   My.Resources    &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;in VB.NET is:&lt;br /&gt;&lt;br /&gt;     &lt;span style="font-family: courier new;"&gt;Properties.Resources &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;in C#.&lt;br /&gt;&lt;br /&gt;So,&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  Me.Icon = My.Resources.AppIcon&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;in VB.NET is equivalent to:&lt;br /&gt;&lt;br /&gt;     &lt;span style="font-family: courier new;"&gt;this.Icon = Properties.Resources.App_Icon;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;in C#.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-2695694207385123326?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/2695694207385123326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=2695694207385123326' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2695694207385123326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2695694207385123326'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/11/myresources-in-c.html' title='My.Resources in C#'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-7966776283727025045</id><published>2011-10-21T12:48:00.000-07:00</published><updated>2011-10-21T12:52:04.468-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='color'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='RGB'/><title type='text'>Computing RGB composite Color Value in C#</title><content type='html'>If you still have to deal with the Win32Api in C#, you may need to get the old-style RGB composite color values from a .NET Color value.   The ToArgb method doesn't work like you want, so it has to be computed:&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;  private int ConvertColorToRGB(Color col)&lt;br /&gt;    {&lt;br /&gt;    return (col.R) | (col.G &amp;lt;&amp;lt; 8) | (col.B &amp;lt;&amp;lt; 16);&lt;br /&gt;    }&lt;br /&gt; &lt;/pre&gt;If you are using VB.NET, it still has an RGB function to call.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-7966776283727025045?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/7966776283727025045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=7966776283727025045' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/7966776283727025045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/7966776283727025045'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/10/computing-rgb-composite-in-c.html' title='Computing RGB composite Color Value in C#'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-842121437224139639</id><published>2011-08-25T08:10:00.000-07:00</published><updated>2011-08-25T08:20:50.950-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='NUM_ROWS'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Updating the NUM_ROWS in USER_TABLES in Oracle</title><content type='html'>Good or bad, I use the NUM_ROWS values in the USER_TABLES table to help filter lists of tables when presenting them to the user.   If I have a database and only about 25% of tables have records (and there are thousands of tables), then it is a lot nicer to only sift through the tables that do have records, and knowing how many records is even better (even if it is only an estimate).   My problem is that these values don't just get updated automatically for you.   You might find that they are all 0 even when there is data present.   You can update all of the values with something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-family: courier new;"&gt;exec dbms_stats.gather_schema_stats('mySchema', cascade=&amp;gt;TRUE)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A lot more info on this topic can be found at:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dba-oracle.com/concepts/tables_optimizer_statistics.htm"&gt;http://www.dba-oracle.com/concepts/tables_optimizer_statistics.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-842121437224139639?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/842121437224139639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=842121437224139639' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/842121437224139639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/842121437224139639'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/08/updating-numrows-in-usertables-in.html' title='Updating the NUM_ROWS in USER_TABLES in Oracle'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-52502375066290953</id><published>2011-07-18T10:13:00.000-07:00</published><updated>2011-07-18T10:20:44.448-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSV'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Creating a .CSV file in ASP.NET</title><content type='html'>I wanting to create a .CSV file from a query to SQL Server in ASP.NET.   The link below has an excellent description of creating the .CSV file without having to create a temp file like I was originally planning to do.   This post doesn't show how to wrap the query results up, but that is pretty simple to figure out:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://wiki.asp.net/page.aspx/401/export-to-csv-file/"&gt;http://wiki.asp.net/page.aspx/401/export-to-csv-file/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-52502375066290953?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/52502375066290953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=52502375066290953' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/52502375066290953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/52502375066290953'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/07/creating-csv-file-in-aspnet.html' title='Creating a .CSV file in ASP.NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-9173686391918396232</id><published>2011-07-14T10:20:00.000-07:00</published><updated>2011-07-14T10:35:52.797-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FolderBrowsingDialog'/><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><title type='text'>Selecting a Folder in VB.NET</title><content type='html'>To go along with my previous &lt;a href="http://dotnetref.blogspot.com/2011/07/selecting-files-to-open-or-save-in.html"&gt;post&lt;/a&gt; on the Open File and Save File dialogs in VB.NET, I am providing this post using &lt;span style="font-weight: bold;"&gt;FolderBrowserDialog &lt;/span&gt;to select a specific Directory.&lt;br /&gt;&lt;br /&gt;Browsing to Select a Directory in VB.NET&lt;br /&gt;&lt;pre name="code" class="Vb"&gt;     Dim dirDlg As New FolderBrowserDialog&lt;br /&gt;&lt;br /&gt;      dirDlg.RootFolder = Environment.SpecialFolder.MyComputer&lt;br /&gt;&lt;br /&gt;      If dirDlg.ShowDialog() = DialogResult.OK Then&lt;br /&gt;&lt;br /&gt;          ' do something with the selected path&lt;br /&gt;          Debug.Print("Directory: " + dirDlg.SelectedPath)&lt;br /&gt;&lt;br /&gt;      Else&lt;br /&gt;&lt;br /&gt;          ' the dialog was cancelled&lt;br /&gt;&lt;br /&gt;      End If&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-weight: bold;"&gt;FolderBrowsingDialog &lt;/span&gt;object has many options, but I have only shown the most commonly used one in the example.   The &lt;span style="font-weight: bold;"&gt;RootFolder &lt;/span&gt;property lets you specify the directory to start browsing from.  You can set this property to an explicit path (like "c:\MyData") or you can use the special directories that are defined for you:&lt;br /&gt;&lt;pre name="code" class="Vb"&gt;Environment.SpecialFolder.MyDocument&lt;br /&gt;Environment.SpecialFolder.MyComputer&lt;br /&gt;Environment.SpecialFolder.MyPictures&lt;br /&gt;Environment.SpecialFolder.Desktop&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;The default is Environment.SpecialFolder.MyComputer.&lt;br /&gt;&lt;br /&gt;After the &lt;span style="font-weight: bold;"&gt;ShowDialog &lt;/span&gt;call returns OK, use the &lt;span style="font-weight: bold;"&gt;SelectedPath&lt;/span&gt; property to get the selected directory.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-9173686391918396232?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/9173686391918396232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=9173686391918396232' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/9173686391918396232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/9173686391918396232'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/07/to-go-along-with-my-previous-post-on.html' title='Selecting a Folder in VB.NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-819639554318181763</id><published>2011-07-14T07:24:00.000-07:00</published><updated>2011-07-19T09:54:09.600-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SaveFileDialog'/><category scheme='http://www.blogger.com/atom/ns#' term='OpenFileDialog'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Selecting Files to Open or Save in VB.NET</title><content type='html'>VB.NET has come a long way from the clunky Common Dialog control of VB6 for implementing a standard dialog that will let you browse to find a file to &lt;span style="font-weight: bold;"&gt;Open &lt;/span&gt;or &lt;span style="font-weight: bold;"&gt;Save&lt;/span&gt;.   Here is an example of each:&lt;br /&gt;&lt;br /&gt;Browsing to Open a File in VB.NET&lt;br /&gt;&lt;pre name="code" class="Vb"&gt;      Dim fileDlg As New OpenFileDialog&lt;br /&gt;&lt;br /&gt; fileDlg.Filter = "CSV File (*.csv)|*.csv|txt files (*.txt)|*.txt|All files (*.*)|*.*"&lt;br /&gt; fileDlg.DefaultExt = "csv"&lt;br /&gt;&lt;br /&gt;' could be omitted to use default, or a specific dir can be given&lt;br /&gt; fileDlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)&lt;br /&gt;&lt;br /&gt; If fileDlg.ShowDialog() = DialogResult.OK Then&lt;br /&gt;&lt;br /&gt;     ' Do something with the selected filename&lt;br /&gt;     Debug.Print(fileDlg.FileName)&lt;br /&gt;&lt;br /&gt; Else&lt;br /&gt;&lt;br /&gt;     ' the dialog was cancelled&lt;br /&gt;&lt;br /&gt; End If&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The &lt;span style="font-weight: bold;"&gt;OpenFileDialog &lt;/span&gt;object is used here, and I have only shown the most commonly used options.  The &lt;span style="font-weight: bold;"&gt;Filter &lt;/span&gt;property lets you specify the which File Types will be selectable form the Open File Dialog (in a dropdown list).  The value is set to a string that is a pipe (|) delimited list composed to a File Type Description and Filter Pattern.  If you have more than one File Type, you can add another pipe, then another Description|Filter Pattern, and so on.  If you leave the Filter property empty, then then Open File Dialog will just not have a drop down to select the File Type filter. Here are some examples:&lt;br /&gt;&lt;br /&gt;"CSV File (*.csv)|*.csv"&lt;br /&gt;"CSV File (*.csv)|*.csv|txt files (*.txt)|*.txt"&lt;br /&gt;"CSV File (*.csv)|*.csv|txt files (*.txt)|*.txt|All files (*.*)|*.*"&lt;br /&gt;&lt;br /&gt;If you are using &lt;span style="font-weight: bold;"&gt;Filter &lt;/span&gt;with more than one File Type specified, you can also use &lt;span style="font-weight: bold;"&gt;DefaultExt&lt;/span&gt; to specify which File Type to use as the default.  Just specify the extension as a string (with no dot).   This property also will set the default file extension to use if you don't specify it in the filename (if typed in), so this property can also be used without the Filter property being set.&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-weight: bold;"&gt;InitialDirectory &lt;/span&gt;property will let you define which directory to open up in.   You can set this property to an explicit path (like "c:\MyData") or you can use the special directories that are defined for you, like:&lt;br /&gt;&lt;pre name="code" class="Vb"&gt;Environment.SpecialFolder.MyDocument&lt;br /&gt;Environment.SpecialFolder.MyComputer&lt;br /&gt;Environment.SpecialFolder.MyPictures&lt;br /&gt;Environment.SpecialFolder.Desktop&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;There is also a &lt;span style="font-weight: bold;"&gt;Title &lt;/span&gt;property that can be used to change the name of the Open File Dialog.   In this example, it is not used and defaults to "Open File".&lt;br /&gt;&lt;br /&gt;After the &lt;span style="font-weight: bold;"&gt;ShowDialog &lt;/span&gt;call returns OK, use the &lt;span style="font-weight: bold;"&gt;FileName &lt;/span&gt;property to get the selected filename.&lt;br /&gt;&lt;br /&gt;Browsing to Save a File in VB.NET&lt;br /&gt;&lt;pre name="code" class="Vb"&gt;   Dim fileDlg As New SaveFileDialog&lt;br /&gt;&lt;br /&gt; fileDlg.Filter = "CSV File (*.csv)|*.csv|txt files (*.txt)|*.txt|All files (*.*)|*.*"&lt;br /&gt; fileDlg.DefaultExt = "csv"&lt;br /&gt;&lt;br /&gt; ' InitialDirectory can be omitted to use default, or used to specify an explicit directory&lt;br /&gt; fileDlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)&lt;br /&gt;&lt;br /&gt; fileDlg.OverwritePrompt = True&lt;br /&gt;&lt;br /&gt; If fileDlg.ShowDialog() = DialogResult.OK Then&lt;br /&gt;&lt;br /&gt;     ' Do something with the selected filename&lt;br /&gt;     Debug.Print(fileDlg.FileName)&lt;br /&gt;&lt;br /&gt; Else&lt;br /&gt;&lt;br /&gt;     ' the dialog was cancelled&lt;br /&gt;&lt;br /&gt; End If&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Saving a file is similar to opening a file.   You use a &lt;span style="font-weight: bold;"&gt;SaveFileDialog &lt;/span&gt;object instead of a &lt;span style="font-weight: bold;"&gt;OpenFileDialog &lt;/span&gt;object.   Many of the properties work the same way as with the OpenFileDialog such as Filter, DefaultExt, and InitialDirectory.   I also show OverwritePrompt set to True (which is the default).  This setting will cause the dialog to prompt you when you try to save over an existing file.&lt;br /&gt;&lt;br /&gt;After the &lt;span style="font-weight: bold;"&gt;ShowDialog &lt;/span&gt;call returns OK, use the &lt;span style="font-weight: bold;"&gt;FileName &lt;/span&gt;property to get the filename.&lt;br /&gt;&lt;br /&gt;If you want to select a Directory instead of a file, look at this &lt;a href="http://dotnetref.blogspot.com/2011/07/to-go-along-with-my-previous-post-on.html"&gt;post&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-819639554318181763?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/819639554318181763/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=819639554318181763' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/819639554318181763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/819639554318181763'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/07/selecting-files-to-open-or-save-in.html' title='Selecting Files to Open or Save in VB.NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-8583877972261821441</id><published>2011-07-13T13:11:00.000-07:00</published><updated>2011-07-13T13:16:25.859-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='memset'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Array.Clear'/><title type='text'>Setting all elements of an Array to Null in C# (like with memset in C++)</title><content type='html'>I sometime find it strange that things we take for granted in C++ are hard in C#.  Probably I should say hard to find the equivalent for rather than hard to do.    I routinely clear out my arrays in C++ with memset (setting each item to 0).   To get the equivalent in C#, you can use the Array.Clear(...) method like this:&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;Array.Clear(MyArray,0,MyArray.Length);&lt;br /&gt;&lt;/pre&gt;Here is a more detailed example:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetperls.com/array-clear"&gt;http://www.dotnetperls.com/array-clear&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-8583877972261821441?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/8583877972261821441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=8583877972261821441' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8583877972261821441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8583877972261821441'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/07/setting-all-elements-of-array-to-null.html' title='Setting all elements of an Array to Null in C# (like with memset in C++)'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-5032387995590612503</id><published>2011-07-12T11:43:00.000-07:00</published><updated>2011-07-12T12:56:14.402-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Flicker'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Preventing Flicker with GDI+ drawing in C#</title><content type='html'>In C#, the &lt;span style="font-weight:bold;"&gt;OnPaintBackground &lt;/span&gt;method is called before the &lt;span style="font-weight: bold;"&gt;OnPaint &lt;/span&gt;event and it draws the background color for the entire view.   If you are already drawing the background in the OnPaint event, then this process will cause flicker.   You can override the &lt;span style="font-weight: bold;"&gt;OnPaintBackground &lt;/span&gt;and just do nothing in it to prevent the flicker:&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;protected override void OnPaintBackground(PaintEventArgs pevent)&lt;br /&gt;{&lt;br /&gt;// do nothing&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-5032387995590612503?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/5032387995590612503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=5032387995590612503' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5032387995590612503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5032387995590612503'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/07/preventing-flicker-with-gdi-drawing-in.html' title='Preventing Flicker with GDI+ drawing in C#'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-2798693895704759394</id><published>2011-06-29T08:13:00.000-07:00</published><updated>2011-06-29T09:59:16.504-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Script to Purge All Objects for a User in Oracle</title><content type='html'>I have to purge and reload an Oracle Database dump on a monthly basis.   I have been manually deleting all of the Objects with Toad before loading the new dump.   I searched for a script that would delete all of the objects.  Many people suggested that you should just drop the user, but if I do this I have to add back in grants that don't get picked up by the export.   &lt;br /&gt;&lt;br /&gt;This &lt;a href="http://forums.oracle.com/forums/thread.jspa?threadID=614090"&gt;thread&lt;/a&gt; on the Oracle Discussion Forum has several solutions.   I am pasting the script that worked the best for me below from Massimo.  There is some criticism in the thread about why he did not just use the object name in one case instead of all the If/Else conditions; however, I like this approach better, because I can easily take out something if I need to:&lt;br /&gt;&lt;pre name="code" class="Sql"&gt;&lt;br /&gt;declare&lt;br /&gt;stringa varchar2(100);&lt;br /&gt;&lt;br /&gt;cursor cur is&lt;br /&gt;      select  *&lt;br /&gt;      from    user_objects;&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;  for c in cur loop&lt;br /&gt;    begin&lt;br /&gt;      stringa := '';&lt;br /&gt;      if c.object_type = 'VIEW' then&lt;br /&gt;          stringa := 'drop view ' || c.object_name;&lt;br /&gt;          EXECUTE immediate stringa;&lt;br /&gt;      elsif c.object_type = 'TABLE' then&lt;br /&gt;          stringa := 'drop table ' || c.object_name || ' cascade constraints';&lt;br /&gt;          EXECUTE immediate stringa;&lt;br /&gt;      elsif c.object_type = 'SEQUENCE' then&lt;br /&gt;          stringa := 'drop sequence ' || c.object_name;&lt;br /&gt;          EXECUTE immediate stringa;&lt;br /&gt;      elsif c.object_type = 'PACKAGE' then&lt;br /&gt;          stringa := 'drop package ' || c.object_name;&lt;br /&gt;          EXECUTE immediate stringa;   &lt;br /&gt;      elsif c.object_type = 'TRIGGER' then&lt;br /&gt;          stringa := 'drop trigger ' || c.object_name;&lt;br /&gt;          EXECUTE immediate stringa;   &lt;br /&gt;      elsif c.object_type = 'PROCEDURE' then&lt;br /&gt;          stringa := 'drop procedure ' || c.object_name;&lt;br /&gt;          EXECUTE immediate stringa;&lt;br /&gt;      elsif c.object_type = 'FUNCTION' then&lt;br /&gt;          stringa := 'drop function ' || c.object_name;&lt;br /&gt;          EXECUTE immediate stringa;     &lt;br /&gt;      elsif c.object_type = 'SYNONYM' then&lt;br /&gt;          stringa := 'drop synonym ' || c.object_name;&lt;br /&gt;          EXECUTE immediate stringa;&lt;br /&gt;      elsif c.object_type = 'INDEX' then&lt;br /&gt;          stringa := 'drop index ' || c.object_name;&lt;br /&gt;          EXECUTE immediate stringa;&lt;br /&gt;      elsif c.object_type = 'PACKAGE BODY' then&lt;br /&gt;          stringa := 'drop PACKAGE BODY ' || c.object_name;&lt;br /&gt;          EXECUTE immediate stringa;  &lt;br /&gt;      elsif c.object_type = 'DATABASE LINK' then&lt;br /&gt;          stringa := 'drop database link ' || c.object_name;&lt;br /&gt;          EXECUTE immediate stringa;  &lt;br /&gt;      end if;&lt;br /&gt;  exception&lt;br /&gt;        when others then&lt;br /&gt;        null;&lt;br /&gt;    end; &lt;br /&gt;  end loop;&lt;br /&gt;  -- PURGE recyclebin&lt;br /&gt;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-2798693895704759394?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/2798693895704759394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=2798693895704759394' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2798693895704759394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2798693895704759394'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/06/purging-all-objects-in-oracle-user.html' title='Script to Purge All Objects for a User in Oracle'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-2018329035313620015</id><published>2011-06-28T13:49:00.000-07:00</published><updated>2011-06-28T14:34:04.552-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='array'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Convert char[] to String in c#</title><content type='html'>If you have something like:&lt;br /&gt;&lt;pre name="code" class="Vb"&gt;&lt;br /&gt;char [] chArray = infile.ReadChars(10);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;or&lt;br /&gt;&lt;pre name="code" class="Vb"&gt;&lt;br /&gt;char[] chArray = new char[] {'t','e','s','t'};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and you want to convert it to a String, I always (incorrectly) try:&lt;br /&gt;&lt;pre name="code" class="Vb"&gt;&lt;br /&gt;String str = chArray.ToString(); &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and it doesn't work (you get "System.Char[]").&lt;br /&gt;&lt;br /&gt;You have to say something like this:&lt;br /&gt;&lt;pre name="code" class="Vb"&gt;&lt;br /&gt;String str = new String(chArray);&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-2018329035313620015?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/2018329035313620015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=2018329035313620015' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2018329035313620015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2018329035313620015'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/06/convert-char-to-string-in-c.html' title='Convert char[] to String in c#'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-1724684189882495502</id><published>2011-06-26T16:26:00.000-07:00</published><updated>2011-06-26T16:41:59.085-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='impdp'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Importing a Datapump export into Oracle with IMPDP</title><content type='html'>I never had to remember the command-line options for the old &lt;span style="font-weight: bold;"&gt;imp &lt;/span&gt;utility (because it prompted you for the info it needed), but with &lt;span style="font-weight: bold;"&gt;impdp&lt;/span&gt;, you need to know what to specify.   Here is my simple example that works for me to import a Datapump export file:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt;impdp user/password schemas=mySchema dumpfile=myfile.dpdmp logfile=mylog.log&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-weight: bold;"&gt;schema &lt;/span&gt;parameter specifies which schema from the file to import.&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-weight: bold;"&gt;dumpfile &lt;/span&gt;parameter specifies the name of the datapump export file to import.   The catch here is that the dump file location defaults to a default directory on the server (something like this):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt;c:\oracle\Administrator\admin\orcl\dpdump&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can change this path, but you have to create the directory in Oracle and specify it with a &lt;span style="font-weight: bold;"&gt;Directory&lt;/span&gt; Parameter.  You have to create a directory in Oracle with something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);font-family:Lucida Console, monospace;" &gt;&lt;span style="font-size:85%;"&gt; create directory MyExportDir as 'c:\exports'&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here is the detailed info for &lt;span style="font-weight: bold;"&gt;impdp &lt;/span&gt;on the &lt;a href="http://wiki.oracle.com/page/Data+Pump+Export+%28expdp%29+and+Data+Pump+Import%28impdp%29"&gt;Oracle site&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-1724684189882495502?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/1724684189882495502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=1724684189882495502' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1724684189882495502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1724684189882495502'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/06/importing-datapump-export-into-oracle.html' title='Importing a Datapump export into Oracle with IMPDP'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-2598401388815114478</id><published>2011-06-26T16:23:00.000-07:00</published><updated>2011-06-26T16:26:11.467-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tablespace'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Creating a Tablespace in Oracle with SQL</title><content type='html'>I never can seem to remember the SQL to create a tablespace in Oracle.  I am posting my example that I use to I can easily find it again in the future:&lt;br /&gt;&lt;br /&gt;&lt;pre class="Sql" name="code"&gt;create tablespace MyTableSpaceName&lt;br /&gt;logging&lt;br /&gt;datafile 'MyTableSpaceFile.dbf'&lt;br /&gt;size 32m&lt;br /&gt;autoextend on&lt;br /&gt;next 32m maxsize unlimited&lt;br /&gt;extent management local;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-2598401388815114478?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/2598401388815114478/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=2598401388815114478' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2598401388815114478'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2598401388815114478'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/06/creating-tablespace-in-oracle-with-sql.html' title='Creating a Tablespace in Oracle with SQL'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-7569516864996810773</id><published>2011-06-26T14:44:00.000-07:00</published><updated>2011-06-26T15:05:18.864-07:00</updated><title type='text'>Oracle Function to Read SDO_ORDINATE Values without causing Exception in .NET</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-VV_ngm96Xvk/Tgeq_8Fov0I/AAAAAAAABLM/3KFoC_Yut7Q/s1600/sdo2.png"&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;Below is an Oracle function to read a specified SDO_ORDINATE value in an SDO_GEOMETRY attribute so that ODP.NET can handle them without causing an Arithmetic Overflow Exception in .NET when the Oracle NUMBER value has too many digits after the decimal place for a .NET Decimal value.&lt;br /&gt;&lt;br /&gt;Most of this function comes from this &lt;a href="http://forums.oracle.com/forums/thread.jspa?threadID=524847&amp;amp;tstart=0"&gt;thread &lt;/a&gt;on the Oracle Discussion Forum:&lt;br /&gt;&lt;br /&gt;&lt;pre class="Sql" name="code"&gt;CREATE OR REPLACE function Get_Ordinate_Value(geom sdo_geometry, vPos number default 1) return number&lt;br /&gt;  is&lt;br /&gt;  begin&lt;br /&gt;&lt;br /&gt;    if geom is null&lt;br /&gt;    then&lt;br /&gt;       return null;&lt;br /&gt;    end if;&lt;br /&gt;&lt;br /&gt;    if vPos &amp;lt;1 or vPos &amp;gt;geom.sdo_ordinates.count()&lt;br /&gt;    then&lt;br /&gt;      return null;&lt;br /&gt;    end if;&lt;br /&gt;&lt;br /&gt;    return round(geom.sdo_ordinates(vPos ),8);&lt;br /&gt;  end;&lt;br /&gt;/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Using the Function is something like this where I am getting the origin point and orientation vector for a 3D Oriented Point geometry:&lt;br /&gt;&lt;br /&gt;&lt;pre class="Sql" name="code"&gt;select Get_Ordinate_Value(MyGeomAttr,1) as X,&lt;br /&gt;        Get_Ordinate_Value(MyGeomAttr,2) as Y,&lt;br /&gt;        Get_Ordinate_Value(MyGeomAttr,3) as Z,&lt;br /&gt;        Get_Ordinate_Value(MyGeomAttr,4) as AngleX,&lt;br /&gt;        Get_Ordinate_Value(MyGeomAttr,5) as AngleY,&lt;br /&gt;        Get_Ordinate_Value(MyGeomAttr,6) as AngleZ&lt;br /&gt;from MyTable&lt;br /&gt;&lt;/pre&gt;&lt;a href="http://1.bp.blogspot.com/-VV_ngm96Xvk/Tgeq_8Fov0I/AAAAAAAABLM/3KFoC_Yut7Q/s1600/sdo2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 164px;" src="http://1.bp.blogspot.com/-VV_ngm96Xvk/Tgeq_8Fov0I/AAAAAAAABLM/3KFoC_Yut7Q/s320/sdo2.png" alt="" id="BLOGGER_PHOTO_ID_5622650675233603394" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;This function is pretty simple.   I first check to see if the geometry attribute is Null and return Null if it is.   I found that if I did not do this, you will get a geometry attribute that is Null passed into the function and you get a "ORA-06531: Reference to uninitialized collection" and it is sometimes hard to tell where it is coming from.&lt;br /&gt;&lt;br /&gt;Then the index is checked to see that it is in range for the SDO_ORDINATE array.&lt;br /&gt;&lt;br /&gt;I finally use the Round function to reduce the number of digits after the decimal point to a number that the .NET Decimal type can handle.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-7569516864996810773?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/7569516864996810773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=7569516864996810773' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/7569516864996810773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/7569516864996810773'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/06/oracle-function-to-read-sdoordinate.html' title='Oracle Function to Read SDO_ORDINATE Values without causing Exception in .NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-VV_ngm96Xvk/Tgeq_8Fov0I/AAAAAAAABLM/3KFoC_Yut7Q/s72-c/sdo2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-5369078495782288956</id><published>2011-06-26T14:15:00.000-07:00</published><updated>2011-06-26T14:43:37.788-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SDO'/><category scheme='http://www.blogger.com/atom/ns#' term='Orinates'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>How to use SQL to retrieve the Vertex values in an SDO_GEOMETRY Attribute</title><content type='html'>It turns out to be more complicated than you might think to simply retrieve the Vertices of an SDO_GEOMETRY attribute in Oracle Spatial using just SQL.   The main problem is that this is an array of an unknown size, so the solution below is just for retrieving the Ordinate values for 1 record identified by a key and each record returned is one Ordinate in the list.&lt;br /&gt;&lt;br /&gt;&lt;pre class="SQL" name="code"&gt;SELECT Round(COLUMN_VALUE,8) as pt&lt;br /&gt;FROM TABLE( SELECT a.MyGeomAttr.SDO_ORDINATES&lt;br /&gt;                    FROM MyTable a&lt;br /&gt;                    WHERE MyKey=24974)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;which will retrieve something like this (my example uses a 3D geometry so there are 3 value per vertex with Z being 0 in all of them):&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-0mnZF_2p3Ak/TgekxuuQKkI/AAAAAAAABLE/xaCZ5ZxohM4/s1600/sdo.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 118px; height: 214px;" src="http://4.bp.blogspot.com/-0mnZF_2p3Ak/TgekxuuQKkI/AAAAAAAABLE/xaCZ5ZxohM4/s320/sdo.png" alt="" id="BLOGGER_PHOTO_ID_5622643834057927234" border="0" /&gt;&lt;/a&gt;  I will go through why I did the things I did to make this work like I wanted below.&lt;br /&gt;&lt;br /&gt;If you are using ODP.NET and you have Oracle Number values in the Ordinates that are larger than a .NET Decimal value (this is common for me), you must use Round (or truncate the value in someway) so that you don't get an Arithmetic Overflow when the Ordinate Value is loaded into a .NET decimal value.   I am using the Round function to simply get 8 decimal points of precision).  It turns out that the data I have uses Oriented Points and the computed vector coordinates use a large number of decimal places that .NET Decimals can't handle.&lt;br /&gt;&lt;br /&gt;To get the Ordinate Values back as the Query results, you must use the TABLE function to convert the SDO_ORDINATES Array to records.   See &lt;a href="http://blog.lishman.com/2008/05/oracle-table-functions.html"&gt;here&lt;/a&gt; for more info on the TABLE function.   The key thing here is that the COLUMN_VALUE is not just me making up a name for my example, it is a keyword that lets you refer to the value the Table function returns (otherwise you can't run the results of the Table function through the Round function).&lt;br /&gt;&lt;br /&gt;The alias "a" seems to be required or you get an error in the query.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-5369078495782288956?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/5369078495782288956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=5369078495782288956' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5369078495782288956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5369078495782288956'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/06/how-to-use-sql-to-retrieve-vertex.html' title='How to use SQL to retrieve the Vertex values in an SDO_GEOMETRY Attribute'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-0mnZF_2p3Ak/TgekxuuQKkI/AAAAAAAABLE/xaCZ5ZxohM4/s72-c/sdo.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-2735834623862943877</id><published>2011-06-26T14:06:00.000-07:00</published><updated>2011-06-26T14:14:34.733-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Counting Unique (Distinct) Records with SQL</title><content type='html'>Using SQL to count all records in a table:&lt;br /&gt;&lt;br /&gt;&lt;pre class="SQL" name="code"&gt;&lt;br /&gt;select count(*) from MyTable&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Using SQL to count all records in a table with unique/distinct values in a particular attribute:&lt;br /&gt;&lt;br /&gt;&lt;pre class="Sql" name="code"&gt;&lt;br /&gt;select count(distinct MyId) from MyTable&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-2735834623862943877?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/2735834623862943877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=2735834623862943877' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2735834623862943877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2735834623862943877'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/06/counting-unique-distinct-records-with.html' title='Counting Unique (Distinct) Records with SQL'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-6723154111690472238</id><published>2011-06-22T07:38:00.000-07:00</published><updated>2011-06-22T07:55:34.039-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='file version'/><category scheme='http://www.blogger.com/atom/ns#' term='auto-increment'/><title type='text'>Auto-Incrementing Assembly and File version in Visual Studio</title><content type='html'>I made a &lt;a href="http://dotnetref.blogspot.com/2008/09/auto-incrementing-file-version-in.html"&gt;post &lt;/a&gt;on this topic some time ago.   I still find it incredible that Visual Studio (2005, 2008, 2010) doesn't provide a way to automatically increment the File Version number in an Assembly.  Why is this important?  To me, the Setup and Deployment project will not deliver a file if the file version is the same (even if the file is newer, different, etc.).   It is very easy to forget to go manually update the assembly's File Version, and you don't find out about it until your users install the updated application and see no difference.&lt;br /&gt;&lt;br /&gt;The method I posted before works fine, but it is a little complicated to setup and get going.&lt;br /&gt;&lt;br /&gt;The new method I found is much easier to setup and use:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://autobuildversion.codeplex.com/"&gt;http://autobuildversion.codeplex.com/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-6723154111690472238?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/6723154111690472238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=6723154111690472238' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/6723154111690472238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/6723154111690472238'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/06/auto-incrementing-assembly-and-file.html' title='Auto-Incrementing Assembly and File version in Visual Studio'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-7707827296116905185</id><published>2011-05-25T09:32:00.000-07:00</published><updated>2011-05-25T09:44:03.681-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TechEd 2011'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Phone 7'/><title type='text'>What's new for Developers in Mango (and RIP .NET CF)</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:officedocumentsettings&gt;   &lt;o:allowpng/&gt;  &lt;/o:OfficeDocumentSettings&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:enableopentypekerning/&gt;    &lt;w:dontflipmirrorindents/&gt;    &lt;w:overridetablestylehps/&gt;   &lt;/w:Compatibility&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="&amp;#45;-"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable  {mso-style-name:"Table Normal";  mso-tstyle-rowband-size:0;  mso-tstyle-colband-size:0;  mso-style-noshow:yes;  mso-style-priority:99;  mso-style-parent:"";  mso-padding-alt:0in 5.4pt 0in 5.4pt;  mso-para-margin-top:0in;  mso-para-margin-right:0in;  mso-para-margin-bottom:10.0pt;  mso-para-margin-left:0in;  line-height:115%;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:"Calibri","sans-serif";  mso-ascii-font-family:Calibri;  mso-ascii-theme-font:minor-latin;  mso-hansi-font-family:Calibri;  mso-hansi-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} &lt;/style&gt; &lt;![endif]--&gt;    &lt;p class="MsoNormal"&gt;&lt;a href="http://northamerica.msteched.com"&gt;TechEd 2011&lt;/a&gt; made me reminisce about my old frienemy the .NET Compact Framework.&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;I will eulogize:&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;Friends and fellow developers, we are here today to pay tribute to our friend of almost 10 years.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;We were coached, pushed, begged, and commanded to embrace you as you made life so much better for us.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Yes, we had to be convinced of that, and we hated you at first.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;You could not go out without a healthy dose of p/invokes, work-arounds, and patches, but we managed to somehow embrace you as your capabilities grew.&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;Now, you are gone. &lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Plucked from us without notice.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;I feel almost as sorry for CF as I did for myself after Microsoft threw its mobile developers under the bus last year when we were told there was no upgrade path from Windows Mobile to Windows Phone 7 (WP7).&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;After &lt;a href="http://dotnetref.blogspot.com/2010/06/windows-phone-7-haves-and-have-nots.html"&gt;stewing &lt;/a&gt;on this new direction last year, I have finally come to the conclusion that the abandonment of Window Mobile was actually a good thing.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;No, I have not embraced WP7.&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;I had never seen another Windows Phone in the wild until I when to TechEd 2011 in Atlanta (and I have had my Samsung Focus since November 2010).&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Needless to say, the popularity of WP7 is so low it would be risky to venture off in that direction at this time.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;I am sure others feel the same way.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;One session at the conference said the ComScores for March 2011 placed Windows Mobile 6 together with WP7 at a 7.5% share of the smartphones in the US (and that is a total of 72.5 million smartphone users). &lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;Just for comparison, Android was 34.7%, RIM was 27.1%, and Apple was 25.5%.&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;Since probably half of Microsoft’s 7.5% share is Windows Mobile, that leaves a paltry base of users to target (close to the Palm share of 2.8%).&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;How many palm apps are people writing today?&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;Now, you may ask why I think Microsoft’s throwing its mobile developers under the bus is a good thing.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Well, it forced me to go develop for Android, BlackBerry, and iOS.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;I have traded my less than 7.5% Microsoft base for a 87.3% base.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;I may one day consider WP7 for my applications, but not today.&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;The moral of the story for Microsoft is that if you tell your developers that they are going to have to rewrite their applications from scratch to run on the new version of the platform, they might spend those resources rewriting their apps for another platform (like Android).&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;This business pattern is unfortunately pretty common (look at Intergraph’s upgrade from FRAMME to G/Technology).&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Compiled from various sessions at TechEd, I will run down the list of the major new features Windows Phone will include for developers in its next released (called Mango): &lt;span style="mso-spacerun:yes"&gt; &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;Currently, the development platform is a subset of Silverlight 3 or a subset of XNA.&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;The Silverlight 3 subset is being upgraded to a Silverlight 4 subset.&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;There was also talk of blending Silverlight and XNA together to overcome problems in each.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;This blending will be at a page level (mixing Silverlight and XNA pages together in the same app) and at an element level (putting Silverlight elements on a XNA page, such as text).&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Regardless, it seems like a crazy mash up on many different levels.&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;From the Silverlight 4 upgrade, new features will include: implicit styles, data binding enhancements, and ICommand support.&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;New interfaces will be available for the camera.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;This feature should finally overcome one of my biggest complaints with WP7, my QR Code scanner app is pretty much useless when you have to take a picture instead of just “scanning”.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Why wasn’t this in the first version?&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;A new Read-only Rich Text Box.&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;Clipboard API.&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;Tap, Double Tap, and Hold Events for Text Box.&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;Red Squiqqlies for misspelled words in a Text Box.&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;Support for Sockets which fills another big hole in the current version.&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;Video Brush so you can draw video on a page.&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;Live Tiles get a new API that allows them to be more accessible and provides new features like text on the Back of a Tile (these tiles flip over periodically to show what is on the back).&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;Single apps can now have multiple tiles and the tiles can deep link to a specific page in the app.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;App can also control the pinning and unpinning of the tiles from the start page.&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;Also, push notification can happen every 15 minutes instead of an hour, and there can now be 30 push notification endpoints instead of 15.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;There is supposed to be support for animation like the Xbox Live and People tiles too.&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;Push Notification Toast can Deep Link to pages in an app too.&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;There is supposed to be some multitasking and background processing too, but I wasn’t too clear on what this would be.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Not having apps like Twitter or IM clients running in the background in the current version really kills the phone’s usefulness for most people.&lt;/li&gt;&lt;/ul&gt; &lt;br /&gt;Beyond the new features for Developers, Mango will also have the following enhancements:&lt;br /&gt; &lt;ul&gt;&lt;li&gt;Windows Phone 7 apps will run in a special mode to keep them compatible with the new version.&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;32 BPP support for images, but defaults to 16 BPP.&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;This feature can be used to fix banding problems with gradient shading (at the expense of performance).&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;Improved battery usage for Video Player which will now draw at ¾ size and scales up (with restrictions like must be right aligned)&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;Input thread introduced in ListBox to improve scrolling.&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;Improvements to memory management that will reduce memory usage in an app by 20 to 30%.&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;Off-thread Image decoding will allow ListBoxes with images to display and then fill in the images without hanging up.&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;Internet Explorer will be upgraded to IE9.&lt;/li&gt;&lt;/ul&gt;  &lt;ul&gt;&lt;li&gt;Rendering and Input for all languages will be supported.&lt;/li&gt;&lt;/ul&gt; &lt;br /&gt;Personally, I really like my Windows Phone as a phone.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;I find it unfortunate that it is too unpopular to invest any resources into developing apps for it.&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;I think the Mango update will certainly help overcome its faults and maybe Nokia will eventually disseminate enough of these phones that their share of the market will be worthwhile.&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;However, realigning development efforts to match the smartphone marketshare is unfortunately more urgent than waiting for Microsoft’s platform to come up to speed.&lt;br /&gt; &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-7707827296116905185?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/7707827296116905185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=7707827296116905185' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/7707827296116905185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/7707827296116905185'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/05/whats-new-for-developers-in-mango-and.html' title='What&apos;s new for Developers in Mango (and RIP .NET CF)'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-7728037047351611555</id><published>2011-02-22T09:27:00.000-08:00</published><updated>2011-02-22T09:30:31.808-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Forms'/><title type='text'>Center a Control on a Form in .NET</title><content type='html'>It turns out to be very easy to center a control on a .NET form.   Just un-anchor the control from any side and it will center from its position.   If you just un-anchor from the left and right it will center horizontally, and if you just un-anchor from the top and bottom, it will center vertically.   Un-anchor from all sides and it will center on the form.&lt;br /&gt;&lt;br /&gt;More info at:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://stackoverflow.com/questions/491399/c-centering-controls-within-a-form-in-net-winforms"&gt;http://stackoverflow.com/questions/491399/c-centering-controls-within-a-form-in-net-winforms&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-7728037047351611555?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/7728037047351611555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=7728037047351611555' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/7728037047351611555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/7728037047351611555'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/02/center-control-on-form-in-net.html' title='Center a Control on a Form in .NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-672075749740525057</id><published>2011-02-11T12:42:00.000-08:00</published><updated>2011-02-11T13:00:37.857-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Native DLL'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>How solve the Problem of loading a Native DLL when using ASP.NET</title><content type='html'>I have had the problem of getting ASP.NET to use a Native DLL for years.   I have even posted my complaints in a previous &lt;a href="http://dotnetref.blogspot.com/2009/09/problems-with-native-dlls-dllimport-and.html"&gt;post&lt;/a&gt;.   My quick and dirty solution has been to simply add the path that contains my DLL to the PATH environment variable and the process would find the .dlls that way.   However, if you are using a hosted ASP.NET site or have clients that simply will NOT modify the PATH environment variable, the work around does not work.   I have finally found the holy grail of information on how to solve this problem.  Why I have not found it before I do not know, and I have search with Google for it a hundred times.&lt;br /&gt;&lt;br /&gt;Here is the post I found:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/b/jorman/archive/2007/08/31/loading-c-assemblies-in-asp-net.aspx"&gt;http://blogs.msdn.com/b/jorman/archive/2007/08/31/loading-c-assemblies-in-asp-net.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For ASP.NET, the solution is very simple and elegant.  I copy it directly from Jerry Orman's excellent post:&lt;br /&gt;&lt;br /&gt;In web.config, add the following…use a path where the Native C++ DLL is located:&lt;br /&gt;&amp;lt;appsettings&amp;gt;&amp;lt;add key="NativePath" value="C:\MyNativeDLLs"&amp;gt;   &amp;lt;/add&amp;gt;&lt;br /&gt;&lt;br /&gt;In global.asax, add the following:&lt;br /&gt;&lt;br /&gt;protected void Application_Start(object sender, EventArgs e){&lt;br /&gt;String _path = String.Concat(System.Environment.GetEnvironmentVariable("PATH"), ";", ConfigurationSettings.AppSettings["NativePath"]);&lt;br /&gt;System.Environment.SetEnvironmentVariable("PATH", _path, EnvironmentVariableTarget.Process);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This post also details other ways of solving the problem as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-672075749740525057?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/672075749740525057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=672075749740525057' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/672075749740525057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/672075749740525057'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2011/02/how-solve-problem-of-loading-native-dll.html' title='How solve the Problem of loading a Native DLL when using ASP.NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-2603612628371722247</id><published>2010-12-01T14:05:00.000-08:00</published><updated>2010-12-01T14:34:38.736-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Service'/><category scheme='http://www.blogger.com/atom/ns#' term='Web.Config'/><category scheme='http://www.blogger.com/atom/ns#' term='AppSettings'/><title type='text'>Reading App Settings from the Web.Config</title><content type='html'>For a Web Service that needs to read information form the web.config file (in its own virtual directory), the following is all you need to read the information:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;using System.Configuration;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt; String value = ConfigurationManager.AppSettings["Param_1"].ToString();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The web.config file would contains something like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_qGIonhYSpfY/TPbLtGp51GI/AAAAAAAABDo/N3uqWQlghwc/s1600/webconfig.png"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 142px;" src="http://2.bp.blogspot.com/_qGIonhYSpfY/TPbLtGp51GI/AAAAAAAABDo/N3uqWQlghwc/s400/webconfig.png" alt="" id="BLOGGER_PHOTO_ID_5545843966894265442" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For more information, go to the following links:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetfunda.com/articles/article13.aspx"&gt;http://www.dotnetfunda.com/articles/article13.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The following link show how to read the root web.config file instead of the one in the virtual directory:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/610xe886.aspx"&gt;http://msdn.microsoft.com/en-us/library/610xe886.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-2603612628371722247?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/2603612628371722247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=2603612628371722247' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2603612628371722247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2603612628371722247'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2010/12/reading-app-settings-from-webconfig.html' title='Reading App Settings from the Web.Config'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_qGIonhYSpfY/TPbLtGp51GI/AAAAAAAABDo/N3uqWQlghwc/s72-c/webconfig.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-8235431724189091506</id><published>2010-08-25T16:46:00.000-07:00</published><updated>2010-08-25T16:49:07.695-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fonts'/><title type='text'>Creating Fixed Spaced Fonts for .NET</title><content type='html'>How to create a fixed space (mono spaced) font for .NET:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Dim f as Font = new Font(FontFamily.GenericMonospace, 12)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-8235431724189091506?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/8235431724189091506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=8235431724189091506' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8235431724189091506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8235431724189091506'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2010/08/creating-fixed-spaced-fonts-for-net.html' title='Creating Fixed Spaced Fonts for .NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-5576922124013968843</id><published>2010-06-14T07:36:00.000-07:00</published><updated>2011-06-28T14:51:34.644-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mango'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Phone 7'/><title type='text'>Windows Phone 7 - The Haves and the Have-Nots</title><content type='html'>&lt;div&gt;While Windows Phone 7 (WP7) sounds intriguing as a platform for iPhone-type applications, TechEd 2010 was very illuminating on the many things that this new platform does not include and why you will unlikely be able to migrate your existing Windows Mobile applications forward. Let me go through the laundry list of the have-nots:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;No native code support&lt;/b&gt;. Silverlight 3.0 and XNA are the only ways to develop applications for WP7. If you are not developing games, then Silverlight is probably the path you will be forced to take.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;No Database support&lt;/b&gt;. SQL Server Compact is not part of WP7. Nor will SQLite or any other 3rd party database engine run either. One TechEd session had the gall to suggest that we should all use collections of objects and Linq as a replacement for SQL Server Compact. Access to data is only available through Web Services and what the application can store in Silverlight’s Isolated Storage. No one would confirm or deny that database support would ever be added to WP7.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;No Side Loading Applications&lt;/b&gt;. Except for development mode, applications can only be loaded to WP7 devices through the Microsoft Marketplace. It doesn’t matter if the app if for internal use in your organization or not. Also, it is not free to use the Microsoft Marketplace.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Application approval is required&lt;/b&gt;. Microsoft claims that it will not be a blackbox like Apple where you stick an app in and hope it comes out; however, they also said they there is a list of applications types that will not be allowed. VOIP was they only example provided.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;No access to data on SD cards&lt;/b&gt;. Since Silverlight applications can only use isolated storage, there is no way for an application to access information on an SD card. While some devices may support an SD card, the additional memory will apparently be made available for isolated storage, but you can’t preload the content.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;No File System support&lt;/b&gt;. Again only Isolated Storage is available to a Silverlight app.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;No RAPI support&lt;/b&gt;. There will no interacting with a WP7 device via the desktop. Obviously there will be some synchronization with Outlook, but nothing the developer will have control of.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Applications must be Silverlight 3&lt;/b&gt;. Silverlight 4 will not be available for WP7.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Out of Browser Silverlight support only&lt;/b&gt;. Silverlight is not going to be supported in browser on the phone.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Default Browser must be Internet Explorer&lt;/b&gt;. While Microsoft claimed that other browsers will be allowed on the phone, they can’t be the default. This is probably okay as long as the new Internet Explorer is better than the Windows Mobile version; however, is it possible to write a viable browser in Silverlight or XNA?&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;No Bluetooth API&lt;/b&gt;. While there is going to be Bluetooth support on the phone, there is no Bluetooth API.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;No inter-process communications (IPC) and no Socket support&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;No Video Capture Support.&lt;/b&gt; Phones will have a camera but not video capture support, and also no video brush.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;No Outside TrueType Fonts &lt;/b&gt;- Microsoft experts claimed that you will not be able to use TrueType fonts other than the ones delivered with the device. This limitation makes since, how would you get them on the device. While there is supposed to be support for embedding TrueType fonts in your xap file in Silverlight 4, this will not be the version used on the device.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;The TechEd demos of WP7 applications had a common theme; they crashed, hung up, or gave peculiar error messages. For a platform that is going to be delivered in the October timeframe (3 months away), it is hard to have much short-term faith in the new platform.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On the positive side, the list is not quite as long:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;The Silverlight apps running on the phones looked good even if they were only Silverlight 3.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Lots of different soft input panels (SIPs) provided like numeric, URL, email, etc.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Built-in support and APIs for multi-touch, accelerometers, vibrator, microphone, and camera.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Phones are not going to be feature locked like Windows Mobiles. They should be upgradable like the iPhone.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Applications on the phones do not have the strange isolated storage limits that desktop Silverlight applications have.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Microsoft continually offered up that they were so rushed to get this phone to market that they had to leave a lot of things out. Since the phones are not feature locked (so they claim), maybe there will be a quick release cycle of new versions to fill in the missing components. If you are not planning on developing iPhone type applications (casual games or casual apps usually requiring a connection to a backend), you may be stuck waiting for a new release will new features (or jumping ship to Android or the iPhone). The WP7 platform as it is depicted today will not be able to support the sophisticated applications that are currently running on Windows Mobile, so it cannot be thought of as a successor to the Window Mobile platform. There are many new and great things you can do on WP7, but this constitutes a different kind of platform (one to compete with the iPhone). Will it grow to be a successor to Windows Mobile? How long will this take? What if it flops against the iPhone and never takes hold? Too many questions around the platform to invest a significant amount of development into it if you are not focused on creating iPhone type apps.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;***** Since I posted this blog entry, I went to another TechEd and wrote another more updated &lt;/span&gt;&lt;a style="font-weight: bold; font-style: italic;" href="http://dotnetref.blogspot.com/2011/05/whats-new-for-developers-in-mango-and.html"&gt;post&lt;/a&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-5576922124013968843?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/5576922124013968843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=5576922124013968843' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5576922124013968843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5576922124013968843'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2010/06/windows-phone-7-haves-and-have-nots.html' title='Windows Phone 7 - The Haves and the Have-Nots'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-4653448941673836052</id><published>2010-06-02T16:35:00.000-07:00</published><updated>2010-06-02T16:41:02.373-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TabControl'/><title type='text'>Preventing Tabs from being Selected</title><content type='html'>I tried several solutions I found on the internet to prevent tabs from being selected with a TabControl, but the link below shows the only solution that worked well.   My task was very simple, I didn't want the user to select other tabs until the first tab contained valid information.   The trick was to use the Deselecting event on the TabControl.  In the event, see which tab you are on (SelectedIndex) and perform your validation specific to the tab.   If the validation fails, set the event's e.Cancel to True and the tab won't change.&lt;br /&gt;&lt;a href="http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Studio_.NET_2005/Q_23411323.html"&gt;&lt;br /&gt;http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Studio_.NET_2005/Q_23411323.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-4653448941673836052?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/4653448941673836052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=4653448941673836052' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/4653448941673836052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/4653448941673836052'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2010/06/preventing-tabs-from-being-selected.html' title='Preventing Tabs from being Selected'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-4458668761856535307</id><published>2010-06-01T09:48:00.000-07:00</published><updated>2010-06-01T09:49:29.677-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XPath'/><title type='text'>XPath Query Syntax</title><content type='html'>The following link give a good review of the XPath Query syntax:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeguru.com/cpp/data/mfc_database/xml/article.php/c7589__1/NET-and-XML-Part-1mdashXPath-Queries.htm"&gt;http://www.codeguru.com/cpp/data/mfc_database/xml/article.php/c7589__1/NET-and-XML-Part-1mdashXPath-Queries.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-4458668761856535307?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/4458668761856535307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=4458668761856535307' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/4458668761856535307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/4458668761856535307'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2010/06/xpath-query-syntax.html' title='XPath Query Syntax'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-5362028079032214785</id><published>2010-05-26T09:25:00.001-07:00</published><updated>2010-05-26T09:28:13.110-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='listview'/><title type='text'>Checkboxes in any Cell in a ListView</title><content type='html'>&lt;div&gt;The built-in Checkbox functionality for ListViews will put a checkbox at the beginning of each row. I only needed to put the check box at the beginning of certain rows.  The following posting show a simply way to achieve this requirement.   I did not use this method exactly as it is shown, but it was definitely a good start:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://bytes.com/topic/visual-basic-net/insights/880195-putting-checkboxes-any-cell-listview"&gt;http://bytes.com/topic/visual-basic-net/insights/880195-putting-checkboxes-any-cell-listview&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-5362028079032214785?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/5362028079032214785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=5362028079032214785' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5362028079032214785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5362028079032214785'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2010/05/checkboxes-in-any-cell-in-listview.html' title='Checkboxes in any Cell in a ListView'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-1227867458727279236</id><published>2010-05-13T13:55:00.000-07:00</published><updated>2010-05-13T13:57:58.158-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DiffMerge'/><title type='text'>DiffMerge - Tool to Compare and Merge Files</title><content type='html'>A free tool to compare and Merge files and folders:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.sourcegear.com/diffmerge/downloads.html"&gt;http://www.sourcegear.com/diffmerge/downloads.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-1227867458727279236?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/1227867458727279236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=1227867458727279236' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1227867458727279236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1227867458727279236'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2010/05/diffmerge-tool-to-compare-and-merge.html' title='DiffMerge - Tool to Compare and Merge Files'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-3109212529691154059</id><published>2010-04-24T08:38:00.000-07:00</published><updated>2010-06-02T16:41:47.572-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='C# to VB.NET'/><title type='text'>VB.NET and C# Comparison</title><content type='html'>Great posting that compares VB.NET and C#:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.harding.edu/fmccown/vbnet_csharp_comparison.html"&gt;http://www.harding.edu/fmccown/vbnet_csharp_comparison.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-3109212529691154059?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/3109212529691154059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=3109212529691154059' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3109212529691154059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3109212529691154059'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2010/04/vbnet-and-c.html' title='VB.NET and C# Comparison'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-8588870108517107228</id><published>2010-04-23T12:26:00.001-07:00</published><updated>2010-04-24T09:54:11.347-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sorting'/><category scheme='http://www.blogger.com/atom/ns#' term='Collections'/><title type='text'>Sorting Collections (Generic.List)</title><content type='html'>Here is a simple example for sorting collections (such as a Generic.List) based on particular attributes in the objects:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://stackoverflow.com/questions/438715/how-sort-a-system-collections-generic-list-in-vb-net"&gt;http://stackoverflow.com/questions/438715/how-sort-a-system-collections-generic-list-in-vb-net&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is another:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codedigest.com/Articles/CSHARP/84_Sorting_in_Generic_List.aspx"&gt;http://www.codedigest.com/Articles/CSHARP/84_Sorting_in_Generic_List.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-8588870108517107228?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/8588870108517107228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=8588870108517107228' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8588870108517107228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8588870108517107228'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2010/04/sorting-collections-genericlist.html' title='Sorting Collections (Generic.List)'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-2685142016909870273</id><published>2010-04-23T06:54:00.000-07:00</published><updated>2010-04-23T06:57:52.377-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Serialization'/><title type='text'>Serializing Objects in .NET as XML or Binary</title><content type='html'>This posting provides a good summary of serializing .NET Objects as XML or Binary:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://devcity.net/Articles/113/1/dotnet_serialization.aspx"&gt;http://devcity.net/Articles/113/1/dotnet_serialization.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-2685142016909870273?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/2685142016909870273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=2685142016909870273' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2685142016909870273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2685142016909870273'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2010/04/serializing-objects-in-net-as-xml-or.html' title='Serializing Objects in .NET as XML or Binary'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-6956531929898512204</id><published>2010-03-31T06:16:00.000-07:00</published><updated>2010-03-31T06:18:07.557-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rectangle'/><title type='text'>Rectangle Structure</title><content type='html'>Here is a pretty good link that shows all of the different results using the different method from the Rectangle class such as Union, Intersection, Inflate, etc.:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.java2s.com/Tutorial/VB/0300__2D-Graphics/CreateRectangleFromSizeAndPoint.htm"&gt;http://www.java2s.com/Tutorial/VB/0300__2D-Graphics/CreateRectangleFromSizeAndPoint.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-6956531929898512204?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/6956531929898512204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=6956531929898512204' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/6956531929898512204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/6956531929898512204'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2010/03/rectangle-structure.html' title='Rectangle Structure'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-8402112169605620012</id><published>2010-03-02T11:43:00.000-08:00</published><updated>2010-03-02T11:44:51.036-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Encryption'/><title type='text'>Simple XOR String Encryption</title><content type='html'>Here is a posting I found on how to Encrypt Strings with an XOR operation:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.eggheadcafe.com/tutorials/aspnet/8b53894c-a889-4914-8c46-122980cc44ae/simple-xor-encryption.aspx"&gt;http://www.eggheadcafe.com/tutorials/aspnet/8b53894c-a889-4914-8c46-122980cc44ae/simple-xor-encryption.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-8402112169605620012?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/8402112169605620012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=8402112169605620012' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8402112169605620012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8402112169605620012'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2010/03/simple-xor-string-encryption.html' title='Simple XOR String Encryption'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-789608720613526395</id><published>2010-02-19T11:32:00.001-08:00</published><updated>2010-02-19T11:33:07.644-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Memory Mapped Files'/><title type='text'>Memory Mapped Files in .NET</title><content type='html'>Here is a link to info on using Memory Mapped Files in .NET:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://weblogs.asp.net/gunnarpeipman/archive/2009/06/21/net-framework-4-0-using-memory-mapped-files.aspx"&gt;http://weblogs.asp.net/gunnarpeipman/archive/2009/06/21/net-framework-4-0-using-memory-mapped-files.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-789608720613526395?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/789608720613526395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=789608720613526395' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/789608720613526395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/789608720613526395'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2010/02/memory-mapped-files-in-net.html' title='Memory Mapped Files in .NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-4734889103358907553</id><published>2010-01-15T09:44:00.000-08:00</published><updated>2010-01-15T09:49:57.985-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>Setting the WCF MaxBufferSize, MaxReceiveMessageSize, and MaxArrayLength in Code instead of App.config</title><content type='html'>While the concept of using the app.config file for configuring the many WCF parameters is a nice idea.  I sometime like setting the values in code.   The most common one for me are MaxBufferSize, MaxReceiveMessageSize, and maxArrayLength because they are usually too small by default for most of my applications.    Below I showthe app.config file with these parameters set and then how you can set the same parameters with code  in C# and VB.NET.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;app.config&lt;/strong&gt;&lt;br /&gt;&lt;pre class="XML" name="code"&gt;&lt;br /&gt;   &lt;binding name="BasicHttpBinding_IImageService" closetimeout="00:01:00" opentimeout="00:01:00" receivetimeout="00:10:00" sendtimeout="00:01:00" allowcookies="false" bypassproxyonlocal="false" hostnamecomparisonmode="StrongWildcard" maxbuffersize="5000000" maxbufferpoolsize="524288" maxreceivedmessagesize="5000000" messageencoding="Text" textencoding="utf-8" transfermode="Buffered" usedefaultwebproxy="true"&gt;&lt;br /&gt;       &lt;readerquotas maxdepth="32" maxstringcontentlength="8192" maxarraylength="5000000" maxbytesperread="4096" maxnametablecharcount="16384"&gt;&lt;br /&gt;       &lt;security mode="None"&gt;&lt;br /&gt;         &lt;transport clientcredentialtype="None" proxycredentialtype="None" realm=""&gt;&lt;br /&gt;         &lt;message clientcredentialtype="UserName" algorithmsuite="Default"&gt;&lt;br /&gt;       &lt;/message&gt;&lt;br /&gt;   &lt;/transport&gt;&lt;br /&gt;&lt;br /&gt;&lt;/security&gt;&lt;/readerquotas&gt;&lt;/binding&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;VB.NET&lt;/strong&gt;&lt;br /&gt;&lt;pre class="Vb" name="code"&gt;&lt;br /&gt;' Increase binding max sizes so that the image can be retrieved&lt;br /&gt;If TypeOf pltSvr.Endpoint.Binding Is ServiceModel.BasicHttpBinding Then&lt;br /&gt;  Dim binding As ServiceModel.BasicHttpBinding = _&lt;br /&gt;          CType(pltSvr.Endpoint.Binding, ServiceModel.BasicHttpBinding)&lt;br /&gt;  Dim max As Integer = 5000000 ' around 5M size allowed&lt;br /&gt;  binding.MaxReceivedMessageSize = max&lt;br /&gt;  binding.MaxBufferSize = max&lt;br /&gt;  binding.ReaderQuotas.MaxArrayLength = max&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;C#&lt;/strong&gt;&lt;br /&gt;&lt;pre class="CSharp" name="code"&gt;&lt;br /&gt;// Increase binding max sizes so that the image can be retrieved&lt;br /&gt;if (pltSvr.Endpoint.Binding is System.ServiceModel.BasicHttpBinding)&lt;br /&gt;{&lt;br /&gt;   System.ServiceModel.BasicHttpBinding binding =&lt;br /&gt;        (System.ServiceModel.BasicHttpBinding)pltSvr.Endpoint.Binding;&lt;br /&gt;&lt;br /&gt;   int max = 5000000;  // around 5M&lt;br /&gt;   binding.MaxReceivedMessageSize = max;&lt;br /&gt;   binding.MaxBufferSize = max;&lt;br /&gt;   binding.ReaderQuotas.MaxArrayLength = max;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-4734889103358907553?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/4734889103358907553/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=4734889103358907553' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/4734889103358907553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/4734889103358907553'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2010/01/setting-wcf-maxbuffersize.html' title='Setting the WCF MaxBufferSize, MaxReceiveMessageSize, and MaxArrayLength in Code instead of App.config'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-460444148194353824</id><published>2009-12-07T08:00:00.000-08:00</published><updated>2009-12-07T08:07:05.227-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RegCap.exe'/><title type='text'>RegCap.exe Unhandled Exception with Deployment Apps</title><content type='html'>If you have Deployment Projects in Visual Studio 2008 (maybe 2005 as well), and your app to deploy uses Make Assembly COM-Visible, RegCap.exe will crash when building the deployment project on Windows 7 (maybe on Vista as well).&lt;br /&gt;&lt;br /&gt;The work-around appears to be running Visual Studio in XP Compatibility mode.&lt;br /&gt;&lt;br /&gt;Here is some more info:&lt;br /&gt;&lt;br /&gt;&lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=466157&amp;amp;wa=wsignin1.0"&gt;https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=466157&amp;amp;wa=wsignin1.0&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-460444148194353824?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/460444148194353824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=460444148194353824' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/460444148194353824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/460444148194353824'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/12/regcapexe-unhandled-exception-with.html' title='RegCap.exe Unhandled Exception with Deployment Apps'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-8188175862516343271</id><published>2009-11-11T06:51:00.000-08:00</published><updated>2009-11-11T06:56:34.651-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Temp Directory'/><title type='text'>Get the User's Temporary Directory in .NET</title><content type='html'>&lt;span style="font-family:courier new;color:#3333ff;"&gt;System.IO.Path.GetTempPath()&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;Environment.GetEnvironmentVariable("temp")&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-8188175862516343271?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/8188175862516343271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=8188175862516343271' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8188175862516343271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8188175862516343271'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/11/get-users-temporary-directory-in-net.html' title='Get the User&apos;s Temporary Directory in .NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-5521590935929864984</id><published>2009-10-27T09:20:00.000-07:00</published><updated>2009-10-27T09:26:40.763-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='regasm'/><title type='text'>How to find Regasm.exe and use it in a .Bat file</title><content type='html'>I need to use RegAsm.exe to register several assemblies in a .bat file; however, since RegAsm.exe is not in the system path, it is difficult to just use like Regsvr32 which is always in the system path.    I suppose the reason for this is that there can be multiple .NET Frameworks installed and you need to use the correct one.&lt;br /&gt;&lt;br /&gt;You can use the WINDIR enviroment variable to get the root of the path.   It will probably be something like:&lt;br /&gt;&lt;br /&gt;C:\WINDOWS&lt;br /&gt;&lt;br /&gt;You then need to add "\Microsft.NET\Framework\" to the path, and finally the path to the specific .NET Framework you are using:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;SET fwpath="%windir%\Microsoft.NET\Framework\v2.0.50727"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;%fwpath%\regasm.exe app.dll&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-5521590935929864984?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/5521590935929864984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=5521590935929864984' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5521590935929864984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5521590935929864984'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/10/how-to-find-regasmexe-and-use-it-in-bat.html' title='How to find Regasm.exe and use it in a .Bat file'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-5269649187569213252</id><published>2009-10-27T09:08:00.000-07:00</published><updated>2009-10-27T10:02:32.112-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MSI'/><category scheme='http://www.blogger.com/atom/ns#' term='CustomActionData'/><title type='text'>How to pass TARGETDIR with CustomActionData and not get an Error</title><content type='html'>Maybe it is just me, but it seems like everything I need to do with an MSI setup is never as easy as it should be. Here is just an other example.&lt;br /&gt;&lt;br /&gt;I need to pass the Target Directory for the installation to the InstallClass that I am using in the MSI Custom Actions (I have to do this because of other things in the MSI that don't work like they should). However, when I define the CustomActionData as:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;/targetPath=[TARGETDIR]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;/targetPath="[TARGETDIR]"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I get the following error:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#990000;"&gt;Error 1001. Exception occurred while initializing the Installation:System.IO.FileNotFoundException&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#990000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The solution I have found is to say this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;/targetPath="[TARGETDIR]\"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I found this info from the following post:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnet247.com/247reference/msgs/35/179584.aspx"&gt;http://www.dotnet247.com/247reference/msgs/35/179584.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I later found the Microsoft documentation on solving the problem:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/2w2fhwzz(VS.71).aspx"&gt;http://msdn.microsoft.com/en-us/library/2w2fhwzz(VS.71).aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-5269649187569213252?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/5269649187569213252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=5269649187569213252' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5269649187569213252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5269649187569213252'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/10/how-to-pass-targetdir-with.html' title='How to pass TARGETDIR with CustomActionData and not get an Error'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-903502489109221649</id><published>2009-10-22T14:14:00.000-07:00</published><updated>2009-10-22T14:16:53.741-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Excel'/><title type='text'>Import an Excel File with VB.NET</title><content type='html'>Here is a simple solution for importing an Excel file into VB.NET using an OleDbConnection:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.experts-exchange.com/Programming/Languages/.NET/Visual_CSharp/Q_22487951.html"&gt;http://www.experts-exchange.com/Programming/Languages/.NET/Visual_CSharp/Q_22487951.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-903502489109221649?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/903502489109221649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=903502489109221649' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/903502489109221649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/903502489109221649'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/10/import-excel-file-with-vbnet.html' title='Import an Excel File with VB.NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-2893056999422126987</id><published>2009-09-16T14:49:00.000-07:00</published><updated>2009-09-16T14:50:15.321-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MemoryStream'/><title type='text'>Some Good Examples of MemoryStream in C#</title><content type='html'>Here are several good examples of using MemoryStream in C#:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.java2s.com/Code/CSharp/File-Stream/CreateaMemoryStream.htm"&gt;http://www.java2s.com/Code/CSharp/File-Stream/CreateaMemoryStream.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-2893056999422126987?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/2893056999422126987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=2893056999422126987' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2893056999422126987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2893056999422126987'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/09/some-good-examples-of-memorystream-in-c.html' title='Some Good Examples of MemoryStream in C#'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-3289119257393273129</id><published>2009-09-16T09:28:00.001-07:00</published><updated>2009-09-16T09:30:36.836-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DateTime'/><category scheme='http://www.blogger.com/atom/ns#' term='Formatting'/><title type='text'>Formatting DateTime in C#</title><content type='html'>Here is an excellent list of the C# Formatting specifications for the &lt;strong&gt;DateTime&lt;/strong&gt; type.  The VB.NET formatting could easily be derived from this post as well:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.csharp-examples.net/string-format-datetime/"&gt;http://www.csharp-examples.net/string-format-datetime/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-3289119257393273129?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/3289119257393273129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=3289119257393273129' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3289119257393273129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3289119257393273129'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/09/formatting-datetime-in-c.html' title='Formatting DateTime in C#'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-8472135316708781823</id><published>2009-09-14T20:36:00.000-07:00</published><updated>2009-09-16T09:35:54.513-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TIFF'/><title type='text'>How to Save a Bitmap as a 1BPP (bitonal) TIFF File in .NET</title><content type='html'>If you try to use the EncoderValue.CompressionCCITT4 value to save a Bitmap out as a 1 BPP Tiff file, you will get an error "Invalid Parameter Value". It turns out that .NET can't go from an RGB to a Bitonal image with the Save method on a Bitmap (no matter how you set the encoder parameters). The following posting by Michael McCloskey solves the problem:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/GDI-plus/BitonalImageConverter.aspx?msg=2020403"&gt;http://www.codeproject.com/KB/GDI-plus/BitonalImageConverter.aspx?msg=2020403&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Easy to use and runs quickly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-8472135316708781823?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/8472135316708781823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=8472135316708781823' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8472135316708781823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8472135316708781823'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/09/how-to-save-bitmap-as-1bpp-bitonal-tiff.html' title='How to Save a Bitmap as a 1BPP (bitonal) TIFF File in .NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-3732486192486119814</id><published>2009-09-03T11:11:00.000-07:00</published><updated>2009-09-03T11:13:03.094-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='64bit'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>My Trials and Tribulations getting a WCF Service running on 64 bit Windows Server 2008 with 32 bit Native Dlls</title><content type='html'>My WCF Service uses a native DLL written in C++.   This native Dll can be 32 bit or 64 bit.   The 32 bit version relies on other 3rd party Dlls that are not available in 64 bit.   And the 64 bit version is the same thing without the 3rd party dependencies.&lt;br /&gt;&lt;br /&gt;1.        IIS 7 is easy enough to work in 32 bit or 64 bit mode (on a 64 bit Windows Server 2008 server).   By default, the application pool is 64 bit, but you can create another application pool for 32 bit applications or change the default application pool to 32 bit by using the “Enable 32-bit Applications” switch under Set Application Pool Defaults.  Then on the Advanced Setting page for your WCF Services Virtual Directory, you can select the Application Pool to use.   More Info: &lt;a href="http://blogs.msdn.com/rakkimk/archive/2007/11/03/iis7-running-32-bit-and-64-bit-asp-net-versions-at-the-same-time-on-different-worker-processes.aspx"&gt;http://blogs.msdn.com/rakkimk/archive/2007/11/03/iis7-running-32-bit-and-64-bit-asp-net-versions-at-the-same-time-on-different-worker-processes.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2.       The \Windows\System32 directory is for 64 bit files on a 64 Bit OS.   And SysWow64 contains the 32 bit files.   (Windows on Windows 64 bit).   Confusing, but once you know, you know.&lt;br /&gt;&lt;br /&gt;3.       Getting a 32 bit app using MFC with shared DLLs running on a 64 bit OS can give you a funny error:  “The application has failed to start because its side-by-side configuration is incorrect”.  The 64 bit OS doesn’t get the standard 32 bit MFC Runtime dlls installed.   So you can deliver the 32 bit dependencies or just recompile the DLL using MFC in a Static Library.   Easy to fix either way, but the error message is not so obvious.  More Info:  &lt;a href="http://www.eggheadcafe.com/conversation.aspx?messageid=31209382&amp;amp;threadid=31189019"&gt;http://www.eggheadcafe.com/conversation.aspx?messageid=31209382&amp;amp;threadid=31189019&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;4.       The WCF Service always runs fine on the development machine.   Deploying it to a real IIS server then has various difficulties to overcome.   Mostly, the problem is with security and permissions.   If you get:  “The caller was not authenticated by the service.”  You can possibly just change the binding from wsHttpBinding to basicHttpBinding in the web.config file.  Here is more discussion on the issue:   &lt;a href="http://stackoverflow.com/questions/284538/wcf-error-the-caller-was-not-authenticated-by-the-service"&gt;http://stackoverflow.com/questions/284538/wcf-error-the-caller-was-not-authenticated-by-the-service&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-3732486192486119814?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/3732486192486119814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=3732486192486119814' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3732486192486119814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3732486192486119814'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/09/my-trials-and-tribulations-getting-wcf.html' title='My Trials and Tribulations getting a WCF Service running on 64 bit Windows Server 2008 with 32 bit Native Dlls'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-9195151097042748688</id><published>2009-09-03T08:03:00.001-07:00</published><updated>2009-09-03T08:25:09.399-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='64bit'/><title type='text'>Simple Way to tell if your .NET app is running in 32bit or 64bit Mode</title><content type='html'>Here is a quick and easy was to tell if your .NET app is running in 32 bit or 64 bit mode:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;C#&lt;/strong&gt;&lt;br /&gt;&lt;pre class="CSharp" name="code"&gt;&lt;br /&gt;bool is64bit = IntPtr.Size == 8;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;VB.NET&lt;/strong&gt;&lt;br /&gt;&lt;pre class="Vb" name="code"&gt;&lt;br /&gt;Dim is64bit As Boolean = IntPtr.Size = 8&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;More information on from:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://channel9.msdn.com/forums/Coffeehouse/465445-How-can-I-tell-if-my-NET-application-is-running-in-64bit-on-the-64bit-server/"&gt;http://channel9.msdn.com/forums/Coffeehouse/465445-How-can-I-tell-if-my-NET-application-is-running-in-64bit-on-the-64bit-server/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-9195151097042748688?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/9195151097042748688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=9195151097042748688' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/9195151097042748688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/9195151097042748688'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/09/simple-way-to-tell-if-your-net-app-is.html' title='Simple Way to tell if your .NET app is running in 32bit or 64bit Mode'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-1474025555436845438</id><published>2009-09-02T13:29:00.000-07:00</published><updated>2009-09-02T14:02:39.823-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Native DLL'/><category scheme='http://www.blogger.com/atom/ns#' term='DllImport'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Problems with Native DLLs, DllImport, and ASP.NET</title><content type='html'>I have long had a problem when using ASP.NET where my native Dlls can't be found when the .NET Assembly calls a function from the native Dll.   The only solution I have been able to find is to put the native DLLs in a directory that is in the system PATH (or in a directory that is already in the PATH like Windows\system32).    I have searched the internet many times and finally found a posting that explains why even if there doesn't appear to be a good solution:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bytes.com/topic/c-sharp/answers/843777-asp-net-dllimport"&gt;http://bytes.com/topic/c-sharp/answers/843777-asp-net-dllimport&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Stephen Cheng explains that the .NET assemblies are copied to a ASP.NET temporary directory before they are are run.   Since the .NET assemblies really don't know anything about the native .DLLs, the native DLLs don't get copied.  When the .NET assembly tries to use a method in the native DLL, it is not there and you get the error message:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt; "An exception of type 'System.EntryPointNotFoundException' occurred in xxx.DLL but was not handled in user code  Additional information: Unable to find an entry point named 'xxxx' in DLL '.\xxx.dll'."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It doesn't matter that the Native dll is in your ASP.NET project's bin directory, because that is not where it is run from.&lt;br /&gt;&lt;br /&gt;The solutions given are to use LoadLibrary to get the dll loaded into memory, but you have to know where it is.    You can turn the shadowCopyBinAssemblies off in the web.config file, but this has &lt;a href="http://www.ajaymatharu.com/side-effect-of-shadowcopybinassemblies/"&gt;problems&lt;/a&gt;.   And finally, you can add the location of the native dll to the system PATH.&lt;br /&gt;&lt;br /&gt;If any one knows of a better solution, please post a comment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-1474025555436845438?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/1474025555436845438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=1474025555436845438' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1474025555436845438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1474025555436845438'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/09/problems-with-native-dlls-dllimport-and.html' title='Problems with Native DLLs, DllImport, and ASP.NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-9157129847824262329</id><published>2009-08-30T13:20:00.001-07:00</published><updated>2009-08-30T13:21:40.289-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='blogger'/><category scheme='http://www.blogger.com/atom/ns#' term='code'/><title type='text'>Posting Code in Blogger</title><content type='html'>This posting is off topic too, but I have finally found some good instructions on posting code samples on Blogger. See this post for details:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://abhisanoujam.blogspot.com/2008/12/blogger-syntax-highlighting.html"&gt;http://abhisanoujam.blogspot.com/2008/12/blogger-syntax-highlighting.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-9157129847824262329?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/9157129847824262329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=9157129847824262329' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/9157129847824262329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/9157129847824262329'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/08/posting-code-in-blogger.html' title='Posting Code in Blogger'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-4669743387772892942</id><published>2009-08-27T10:05:00.000-07:00</published><updated>2009-08-27T10:06:49.522-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='iisreset'/><title type='text'>Restarting IIS from the Command-Line</title><content type='html'>This posting is a little off topic, but I always forget the command-line command to restart IIS.  It is simply:   &lt;strong&gt;iisreset&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is more info at:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/003ed2fe-6339-4919-b577-6aa965994a9b.mspx?mfr=true"&gt;http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/003ed2fe-6339-4919-b577-6aa965994a9b.mspx?mfr=true&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-4669743387772892942?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/4669743387772892942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=4669743387772892942' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/4669743387772892942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/4669743387772892942'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/08/restarting-iis-from-command-line.html' title='Restarting IIS from the Command-Line'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-1469285298404205240</id><published>2009-08-04T14:19:00.000-07:00</published><updated>2009-08-04T14:24:03.110-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ModifierKeys'/><title type='text'>How to tell in VB.NET or C# if the Ctrl or Shift Key are being pressed</title><content type='html'>Sometimes you may need to know if the Ctrl or Shift key is being pressed by checking its state instead of using a key event.   Also, most solutions to this problem involve some pinvoking and the win32api GetKeyState, but it turns out to be very simple as this posting describes:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://predicatet.blogspot.com/2008/04/how-to-detect-if-shift-or-control-key.html"&gt;http://predicatet.blogspot.com/2008/04/how-to-detect-if-shift-or-control-key.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is the gist:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;if (Control.ModifierKeys == Keys.Control)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-1469285298404205240?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/1469285298404205240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=1469285298404205240' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1469285298404205240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1469285298404205240'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/08/how-to-tell-in-vbnet-or-c-if-ctrl-or.html' title='How to tell in VB.NET or C# if the Ctrl or Shift Key are being pressed'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-3428042947435302551</id><published>2009-07-22T16:35:00.001-07:00</published><updated>2009-07-31T06:53:30.517-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CHM'/><category scheme='http://www.blogger.com/atom/ns#' term='XML Documentation'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML Help'/><title type='text'>Getting Started Building HTML Help Files (.CHM) from Visual Studio's XML Documentation</title><content type='html'>If you want to build HTML Help files (.CHM) from the XML Documentation embedded in your .NET code, here is a good post on how to get started:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://saftsack.fs.uni-bayreuth.de/~dun3/archives/integrate-xml-code-comments-into-visual-studio-20052008-using-sandcastle-and-html-help-20/150.html"&gt;http://saftsack.fs.uni-bayreuth.de/~dun3/archives/integrate-xml-code-comments-into-visual-studio-20052008-using-sandcastle-and-html-help-20/150.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is some more information after you get going:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/XML/csharpcodedocumentation.aspx"&gt;http://www.codeproject.com/KB/XML/csharpcodedocumentation.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is even more good info on the XML Documentation Syntax from Alan Dean:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://thoughtpad.net/alan-dean/cs-xml-documentation.html"&gt;http://thoughtpad.net/alan-dean/cs-xml-documentation.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-3428042947435302551?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/3428042947435302551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=3428042947435302551' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3428042947435302551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3428042947435302551'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/07/getting-started-building-html-help.html' title='Getting Started Building HTML Help Files (.CHM) from Visual Studio&apos;s XML Documentation'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-2778999356373173624</id><published>2009-07-22T15:46:00.000-07:00</published><updated>2009-07-22T15:50:53.299-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CHM'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML Help'/><title type='text'>Making your .CHM FIles (HTML Help) use a larger Font</title><content type='html'>This post is a little off topic, but this tip is worth a little more press.&lt;br /&gt;&lt;br /&gt;If you can't read a .CHM file (HTML Help file) because the font is just too small, you can make it readable again (Thanks Garth Jones).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://smsug.ca/blogs/garth_jones/archive/2008/10/20/tip-of-the-day.aspx"&gt;http://smsug.ca/blogs/garth_jones/archive/2008/10/20/tip-of-the-day.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;Options/Internet Options/Accessibility -&gt;  Ignore Fonts Sizes on specified Web pages&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-2778999356373173624?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/2778999356373173624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=2778999356373173624' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2778999356373173624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2778999356373173624'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/07/making-your-chm-files-html-help-use.html' title='Making your .CHM FIles (HTML Help) use a larger Font'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-2132008532842792130</id><published>2009-07-20T14:55:00.001-07:00</published><updated>2009-07-20T16:39:00.361-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IDisposable'/><title type='text'>Good Example of using IDisposable with File Streams</title><content type='html'>Here is a simple, yet good example of how to implement IDisposable when dealing with File Streams:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.blackwasp.co.uk/IDisposable.aspx"&gt;http://www.blackwasp.co.uk/IDisposable.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is a similar example with some discussion, but the first link is probably better:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://stackoverflow.com/questions/1136210/am-i-implementing-idisposable-correctly"&gt;http://stackoverflow.com/questions/1136210/am-i-implementing-idisposable-correctly&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-2132008532842792130?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/2132008532842792130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=2132008532842792130' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2132008532842792130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2132008532842792130'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/07/good-example-of-using-idisposable-with.html' title='Good Example of using IDisposable with File Streams'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-4642857107139523031</id><published>2009-07-20T14:34:00.000-07:00</published><updated>2009-07-20T14:36:38.658-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Code Analysis'/><category scheme='http://www.blogger.com/atom/ns#' term='FXCop'/><title type='text'>Creating Custom Dictionary for Code Analysis in Visual Studio</title><content type='html'>Here is a good description of how to add your own custom words to the spelling dictionary used by Visual Studio's Code Analysis Naming rules (also known as FXCop):&lt;br /&gt;&lt;br /&gt;&lt;a href="http://duncanjasmith.blogspot.com/2008/07/creating-custom-dictionary-for-code.html"&gt;http://duncanjasmith.blogspot.com/2008/07/creating-custom-dictionary-for-code.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-4642857107139523031?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/4642857107139523031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=4642857107139523031' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/4642857107139523031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/4642857107139523031'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/07/creating-custom-dictionary-for-code.html' title='Creating Custom Dictionary for Code Analysis in Visual Studio'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-881691040338100746</id><published>2009-07-17T17:20:00.000-07:00</published><updated>2009-07-17T17:22:31.563-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Bing Maps'/><category scheme='http://www.blogger.com/atom/ns#' term='Virtual Earth'/><title type='text'>Getting Started with Virtual Earth/Bing Maps</title><content type='html'>Here is a great video on how to get going with Virtual Earth (now Bing Maps).&lt;br /&gt;&lt;br /&gt;This video gets you through all of the problems that show up that the documentation fails to cover.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.liveside.net/developer/archive/2008/09/29/video-getting-started-with-the-virtual-earth-web-service.aspx"&gt;http://www.liveside.net/developer/archive/2008/09/29/video-getting-started-with-the-virtual-earth-web-service.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-881691040338100746?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/881691040338100746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=881691040338100746' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/881691040338100746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/881691040338100746'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/07/getting-started-with-virtual-earthbing.html' title='Getting Started with Virtual Earth/Bing Maps'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-2703157400499226676</id><published>2009-07-06T11:26:00.000-07:00</published><updated>2009-07-06T11:31:31.800-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Exit Code'/><title type='text'>Setting the Exit Code when exiting a VB.NET or C# Console App</title><content type='html'>To set the Exit Code (ErrorLevel) when a VB.NET or C# Console Application exits, use the following (or similar):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Dim retCode as Integer = 0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;.&lt;br /&gt;System.Environment.Exit( retCode)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The call to Exit will end the application.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-2703157400499226676?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/2703157400499226676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=2703157400499226676' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2703157400499226676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2703157400499226676'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/07/setting-exit-code-when-exiting-vbnet-or.html' title='Setting the Exit Code when exiting a VB.NET or C# Console App'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-8026069886000959001</id><published>2009-07-02T17:33:00.000-07:00</published><updated>2009-07-02T17:43:03.861-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='RegEx'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Like'/><title type='text'>Implementing a SQL-like 'LIKE' Comparison in VB.NET</title><content type='html'>I searched the net for some time to find an easy way to implement the logic in the SQL LIKE in a VB.NET function.   There were many over simplified examples.   Then I found this elegant solution using regular expressions (regex).   The original is found here in C#:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bytes.com/groups/net-c/253519-using-regex-create-sqls-like-like-function"&gt;http://bytes.com/groups/net-c/253519-using-regex-create-sqls-like-like-function&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I have provided a VB.Net version below:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Public Function IsSqlLikeMatch(ByVal input As String, ByVal pattern As String) As Boolean&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;' Turn "off" all regular expression related syntax in&lt;br /&gt;' the pattern string. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;pattern = Regex.Escape(pattern)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;' Replace the SQL LIKE wildcard metacharacters with the&lt;br /&gt;' equivalent regular expression metacharacters. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;pattern = pattern.Replace("%", ".*?").Replace("_", ".")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;' The previous call to Regex.Escape actually turned off&lt;br /&gt;' too many metacharacters, i.e. those which are recognized by&lt;br /&gt;' both the regular expression engine and the SQL LIKE&lt;br /&gt;' statement ([...] and [^...]). Those metacharacters have&lt;br /&gt;' to be manually unescaped here. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;pattern = pattern.Replace("\[", "[").Replace("\]", "]").Replace("\^", "^")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Return Regex.IsMatch(input, pattern)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;End Function&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-8026069886000959001?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/8026069886000959001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=8026069886000959001' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8026069886000959001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8026069886000959001'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/07/implementing-sql-like-like-comparison.html' title='Implementing a SQL-like &apos;LIKE&apos; Comparison in VB.NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-343488579466725839</id><published>2009-06-25T11:08:00.000-07:00</published><updated>2009-06-25T11:17:18.356-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET to C#'/><category scheme='http://www.blogger.com/atom/ns#' term='SharpDevelop'/><category scheme='http://www.blogger.com/atom/ns#' term='C# to VB.NET'/><title type='text'>Converting code between VB.NET and C# using SharpDevelop</title><content type='html'>While I really love the online VB.NET to C# and C# to VB.NET &lt;a href="http://www.developerfusion.com/tools/convert/vb-to-csharp/"&gt;code converters&lt;/a&gt; provided by developerFusion, I have also found the open source SharpDevelop application to be a very good tool for converting .NET code from one flavor to another.   It is especially good at converting whole projects or larger amounts of code.   I think it is worthy a post:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.icsharpcode.net/OpenSource/SD/"&gt;http://www.icsharpcode.net/OpenSource/SD/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Code Conversion Features:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://community.sharpdevelop.net/blogs/mattward/articles/FeatureTourCodeConversion.aspx"&gt;http://community.sharpdevelop.net/blogs/mattward/articles/FeatureTourCodeConversion.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Code Conversion is one very small part of SharpDevelop.  The rest is worth a look too!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-343488579466725839?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/343488579466725839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=343488579466725839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/343488579466725839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/343488579466725839'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/06/converting-code-between-vbnet-and-c.html' title='Converting code between VB.NET and C# using SharpDevelop'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-6720928238773820392</id><published>2009-06-05T10:05:00.000-07:00</published><updated>2009-06-05T10:18:05.012-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Byte Array'/><category scheme='http://www.blogger.com/atom/ns#' term='String'/><title type='text'>Converting a Byte Array to a String in VB.NET</title><content type='html'>Here is one way to convert a byte array to a String in VB.NET:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Dim bArray() As Byte = {65, 66, 67, 68, 69}&lt;br /&gt;Dim str As String&lt;br /&gt;str = System.Text.Encoding.ASCII.GetString(bArray)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;More examples of converting Byte Arrays to Strings and vice versa in VB.NET and C# can be found here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.chilkatsoft.com/faq/DotNetStrToBytes.html"&gt;http://www.chilkatsoft.com/faq/DotNetStrToBytes.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-6720928238773820392?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/6720928238773820392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=6720928238773820392' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/6720928238773820392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/6720928238773820392'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/06/converting-byte-array-to-string-in.html' title='Converting a Byte Array to a String in VB.NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-180663111383222193</id><published>2009-06-05T10:02:00.001-07:00</published><updated>2009-06-05T10:05:03.501-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AppStartupPath'/><title type='text'>Getting Application Path for a Console App</title><content type='html'>In a previous &lt;a href="http://dotnetref.blogspot.com/2007/06/get-applications-path.html"&gt;post&lt;/a&gt;, I gave examples of getting the Application Path for a Windows Form app and a Windows Mobile app.   Getting the Application Path for a Console app is similar to getting one for the Windows Mobile app:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Dim appPath As String = _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;             System.IO.Path.GetDirectoryName( _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt; System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-180663111383222193?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/180663111383222193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=180663111383222193' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/180663111383222193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/180663111383222193'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/06/getting-application-path-for-console.html' title='Getting Application Path for a Console App'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-887162375749808586</id><published>2009-05-18T10:08:00.000-07:00</published><updated>2009-05-18T10:09:57.261-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TechEd 2009'/><title type='text'>TechEd 2009 in Los Angeles</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_MQXAsDgZOmo/ShGVgi9DuII/AAAAAAAAAVQ/XLHTPyG2rmo/s1600-h/IMG_1220.jpg"&gt;&lt;img style="WIDTH: 320px; HEIGHT: 240px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5337211419782002818" border="0" alt="" src="http://1.bp.blogspot.com/_MQXAsDgZOmo/ShGVgi9DuII/AAAAAAAAAVQ/XLHTPyG2rmo/s320/IMG_1220.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This year the TechEd Developers Conference was merged with the TechEd IT conference and happened last week in Los Angeles. While there were significantly fewer Developer oriented sessions, it was interesting to sit in some of the IT sessions. With around 700 sessions to choose from and only about 20 you can actually attend, the need to be particular about what you want to learn becomes very important. I heavily weighted my track with “Mobile”, but I also checked out SQL Server’s Spatial capabilities, and the future directions of the development environments and programming languages.&lt;br /&gt;&lt;br /&gt;The push, I mean focus, this year was definitely the yet to be released Windows 7 and Windows Server 2008 R2, followed by a healthy dose of Virtualization in the form of Hyper-V and Windows Virtual PC.&lt;br /&gt;&lt;br /&gt;I did have an opportunity to run my apps on a beta copy of Windows 7 at the “Bring Your Own App Lab.” There were a few glitchy things with reading some values out of the registry, but overall I was very pleased with how my apps worked the first time on Windows 7. I have already checked off a lot of grief on my to-do list from this experience. The free booze they were passing out was not even necessary to favorably color my opinion of Windows 7.&lt;br /&gt;&lt;br /&gt;The focus last year was definitely LINQ, which seems to have been toned down now to is actual value. WPF and Silverlight, looked cool to try, but now they look usable. Microsoft’s creation of tools to help spawn the development of new programming languages is supposed to bring about an explosion in new languages. I along with everyone else in the Polyglot Programmer session cringed at the idea of having to learn dozens of new languages, but like LINQ, this idea may fade into a manageable and productive tool in our programming arsenal. I was hoping to see Windows Workflow (WF) be a hotter topic than it apparently is, but it may take a few iterations before it catches on.&lt;br /&gt;&lt;br /&gt;I was pretty pleased with &lt;a href="http://www.msteched.com/teched/default.aspx"&gt;TechEd 2009&lt;/a&gt;. I will continue to process the information for a while.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_MQXAsDgZOmo/ShGVdE_s7nI/AAAAAAAAAVI/veaJAUJkPnI/s1600-h/IMG_1218.jpg"&gt;&lt;img style="WIDTH: 320px; HEIGHT: 240px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5337211360200420978" border="0" alt="" src="http://4.bp.blogspot.com/_MQXAsDgZOmo/ShGVdE_s7nI/AAAAAAAAAVI/veaJAUJkPnI/s320/IMG_1218.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-887162375749808586?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/887162375749808586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=887162375749808586' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/887162375749808586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/887162375749808586'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/05/teched-2009-in-los-angeles.html' title='TechEd 2009 in Los Angeles'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_MQXAsDgZOmo/ShGVgi9DuII/AAAAAAAAAVQ/XLHTPyG2rmo/s72-c/IMG_1220.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-5211979962792934344</id><published>2009-05-05T17:26:00.001-07:00</published><updated>2009-05-05T17:27:11.871-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scaling'/><category scheme='http://www.blogger.com/atom/ns#' term='Rectangle'/><title type='text'>Scaling one Rectangle to fit in Another Rectangle</title><content type='html'>Here is a great posting that shows several approaches to scaling one rectangle to fit inside of another:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.vbdotnetforums.com/graphics-gdi/33829-scale-rectangle-fit-another.html"&gt;http://www.vbdotnetforums.com/graphics-gdi/33829-scale-rectangle-fit-another.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-5211979962792934344?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/5211979962792934344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=5211979962792934344' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5211979962792934344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5211979962792934344'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/05/scaling-one-rectangle-to-fit-in-another.html' title='Scaling one Rectangle to fit in Another Rectangle'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-2016855522447829596</id><published>2009-04-13T08:36:00.000-07:00</published><updated>2009-04-13T09:31:58.784-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MachineName'/><category scheme='http://www.blogger.com/atom/ns#' term='GetComputerName'/><title type='text'>GetComputerName equivalent in VB.NET and C#</title><content type='html'>The Win32Api GetComputerName has a simpler equivalent in the .NET world:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Dim compName as String = Environment.MachineName.ToString&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-2016855522447829596?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/2016855522447829596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=2016855522447829596' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2016855522447829596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2016855522447829596'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/04/getcomputername-equivalent-in-vbnet-and.html' title='GetComputerName equivalent in VB.NET and C#'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-2102548901820387736</id><published>2009-04-08T10:25:00.000-07:00</published><updated>2009-04-08T13:20:48.527-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OleDb'/><category scheme='http://www.blogger.com/atom/ns#' term='OraOleDb'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='Version'/><title type='text'>Getting the Version of an OleDB Provider</title><content type='html'>There may a much simpler way of determining the version of an OleDb provider (like OraOledb.Oracle.1) than I have shown below, but I have yet to find one.&lt;br /&gt;&lt;br /&gt;The OleDbConnection object will tell you the version fo the Server through its ServerVersion property:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;Dim myConn As New OleDbConnection(g_gtech.GetConnectionString)&lt;br /&gt;myConn.Open()&lt;br /&gt;Dim versionStr as String = myConn.ServerVersion.ToString&lt;br /&gt;myConn.Dispose()&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But, I often want to the know the version of the Provider it self. The only way I have found to do this is to sift through the registry and read the ProductVersion off the provider dll itself.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;Dim versionStr as String = _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;GetProviderVersion("OraOleDb.Oracle.1")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here is the supporting code:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;Public Function GetProviderVersion(ByVal providerName As String) As String&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;Try&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;Dim clsid As String = GetRegistryValue(Registry.LocalMachine, _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;"SOFTWARE\Classes\" + providerName + "\clsid", "")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;If clsid.Trim = "" Then Return "Not Installed"&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;Dim path As String = _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;GetRegistryValue(Registry.LocalMachine, "SOFTWARE\Classes\CLSID\" + clsid + "\InprocServer32", "")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;Dim Info As FileVersionInfo&lt;br /&gt;Info = FileVersionInfo.GetVersionInfo(path)&lt;br /&gt;Return Info.ProductVersion.ToString&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;Catch ex As Exception&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;&lt;br /&gt;Return "Unable to get Version"&lt;br /&gt;&lt;br /&gt;End Try&lt;br /&gt;&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;Public Function GetRegistryValue(ByVal regKey As RegistryKey, _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;ByVal subKey As String, ByVal valueName As String) As String&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;&lt;br /&gt;Dim value As String = ""&lt;br /&gt;Dim registryKey As RegistryKey = regKey&lt;br /&gt;Dim registrySubKey As RegistryKey&lt;br /&gt;registrySubKey = registryKey.OpenSubKey(subKey)&lt;br /&gt;If registrySubKey IsNot Nothing Then&lt;br /&gt;Try&lt;br /&gt;value = registrySubKey.GetValue(valueName).ToString&lt;br /&gt;Catch ex As Exception&lt;br /&gt;value = ""&lt;br /&gt;End Try&lt;br /&gt;registrySubKey.Close()&lt;br /&gt;End If&lt;br /&gt;Return value&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#333333;"&gt;If there is a simple or more elegant way to find the Provider version, please comment.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-2102548901820387736?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/2102548901820387736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=2102548901820387736' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2102548901820387736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2102548901820387736'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/04/getting-version-of-oledb-provider.html' title='Getting the Version of an OleDB Provider'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-1439307422466754209</id><published>2009-03-27T13:15:00.000-07:00</published><updated>2011-06-28T14:41:58.526-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DateTimePicker'/><title type='text'>Setting the DateTimePicker to a Blank Value</title><content type='html'>I wanted to use the &lt;strong&gt;DateTimePicker&lt;/strong&gt; control on a data entry form; however, it always has to be set to a value.   I did not want to set the date value to Now or some other preset value because it is not clear to the user that the value needs to be set.   I found several solutions to this problem, but the one below appears to work and is easy to use.&lt;br /&gt;&lt;br /&gt;Initialize the DateTimePicker control to a blank value by setting the Format property to Custom and the CustomFormat property to a space (" "):&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="Vb"&gt;DateTimePickerConstDate.CustomFormat = " "&lt;br /&gt;DateTimePickerConstDate.Format = DateTimePickerFormat.Custom&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then, when the value changes, change the Format property back to its original value (or define a usable Custom Format:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="Vb"&gt;Private Sub DateTimePickerConstDate_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DateTimePickerConstDate.ValueChanged&lt;br /&gt;&lt;br /&gt;DateTimePickerConstDate.Format = DateTimePickerFormat.Short&lt;br /&gt;&lt;br /&gt;End Sub&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;For more information on this solution and other approaches, see the following:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://social.msdn.microsoft.com/Forums/en-US/netfxcompact/thread/46b2a370-72ec-485c-9361-bfa505bb6863/"&gt;http://social.msdn.microsoft.com/Forums/en-US/netfxcompact/thread/46b2a370-72ec-485c-9361-bfa505bb6863/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-1439307422466754209?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/1439307422466754209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=1439307422466754209' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1439307422466754209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1439307422466754209'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/03/setting-datetimepicker-to-blank-value.html' title='Setting the DateTimePicker to a Blank Value'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-3358393831982452145</id><published>2009-03-22T07:57:00.000-07:00</published><updated>2009-03-22T09:20:51.262-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sort By'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Sorting a VarChar Attribute as a Number in a SQL Statement</title><content type='html'>This post is not particularly .NET, but I am posting it anyway.&lt;br /&gt;&lt;br /&gt;I was needing to sort the results of a &lt;span id="SPELLING_ERROR_0" class="blsp-spelling-error"&gt;SQL&lt;/span&gt; statements by a Priority attribute (which has the values 1 to 10). &lt;span id="SPELLING_ERROR_1" class="blsp-spelling-corrected"&gt;Unfortunately&lt;/span&gt;, the Priority attribute is defined as &lt;span id="SPELLING_ERROR_2" class="blsp-spelling-error"&gt;VarChar&lt;/span&gt;, so 10 always follows 1 when you do an ORDER BY Priority.&lt;br /&gt;&lt;br /&gt;There are many solutions to this problem, but this simplest (although not the more readily obvious, and maybe not the most efficient) is this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SELECT * FROM Data_Table ORDER BY &lt;strong&gt;Len(Priority), Priority &lt;span id="SPELLING_ERROR_3" class="blsp-spelling-error"&gt;ASC&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Another approach is:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SELECT * FROM Data_Table ORDER BY &lt;strong&gt;RIGHT('0000' + RTRIM(LTRIM(Priority)), 4)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There are other approaches in the posts where I found this solution:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81901"&gt;http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81901&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.eggheadcafe.com/conversation.aspx?messageid=29907381&amp;amp;threadid=29907381"&gt;http://www.eggheadcafe.com/conversation.aspx?messageid=29907381&amp;amp;threadid=29907381&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-3358393831982452145?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/3358393831982452145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=3358393831982452145' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3358393831982452145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3358393831982452145'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/03/sorting-varchar-attribute-as-number-in.html' title='Sorting a VarChar Attribute as a Number in a SQL Statement'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-5339506652482450354</id><published>2009-02-12T14:15:00.000-08:00</published><updated>2009-02-12T14:18:14.154-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='StreamWriter'/><category scheme='http://www.blogger.com/atom/ns#' term='Append'/><title type='text'>Appending a File with StreamWriter</title><content type='html'>The StreamWriter class has an Append flag that can be set to append to the file:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#000099;"&gt;Dim outfile As New StreamWriter(filename, True)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;color:#000099;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;color:#000099;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;The are other overloaded versions with the append flag as well.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-5339506652482450354?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/5339506652482450354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=5339506652482450354' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5339506652482450354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5339506652482450354'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2009/02/appending-file-with-streamwriter.html' title='Appending a File with StreamWriter'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-4486463701399666695</id><published>2008-12-17T12:41:00.000-08:00</published><updated>2008-12-17T12:51:46.939-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Process Explorer'/><title type='text'>Utility: Process Explorer</title><content type='html'>This article in PC Magazine discusses a utility called the Process Explorer (free from Sysinternals):&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pcmag.com/article2/0,2817,2332918,00.asp"&gt;http://www.pcmag.com/article2/0,2817,2332918,00.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The utility can be downloaded from:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx"&gt;http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This utility is like Task Manager's Process Viewer, only it tells much more information that can be used to diagnose problems.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-4486463701399666695?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/4486463701399666695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=4486463701399666695' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/4486463701399666695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/4486463701399666695'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/12/utility-process-explorer.html' title='Utility: Process Explorer'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-1722251617292704476</id><published>2008-11-18T15:16:00.000-08:00</published><updated>2008-11-18T15:18:19.625-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='registry'/><category scheme='http://www.blogger.com/atom/ns#' term='Compact Framework'/><title type='text'>How to determine the .NET Compact Framework Version on the Device</title><content type='html'>Here is the best posting I have found to determine the version of the .NET Compact Framework on the device:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.byteswired.com/2007/09/27/how-to-determine-compactframework-version/"&gt;http://www.byteswired.com/2007/09/27/how-to-determine-compactframework-version/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The summary is that you look at the registry key:&lt;br /&gt;&lt;br /&gt;HKLM\SOFTWARE\Microsoft\.NetCompactFramework&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-1722251617292704476?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/1722251617292704476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=1722251617292704476' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1722251617292704476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1722251617292704476'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/11/how-to-determine-net-compact-framework.html' title='How to determine the .NET Compact Framework Version on the Device'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-700322955977758188</id><published>2008-11-11T14:51:00.000-08:00</published><updated>2008-11-11T14:53:57.003-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Environment'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Mobile'/><title type='text'>Determine OS version with .NET Compact Framework</title><content type='html'>If you are running a Device application and want to know (in the code) which platform you are running on (it could be CE.NET or Windows Mobile or various versions of each), then you can use:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;     Environment.OSVersion.Platform &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For much more information and several examples, see:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.christec.co.nz/blog/archives/77"&gt;http://www.christec.co.nz/blog/archives/77&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-700322955977758188?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/700322955977758188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=700322955977758188' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/700322955977758188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/700322955977758188'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/11/determine-os-version-with-net-compact.html' title='Determine OS version with .NET Compact Framework'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-8615936250537474939</id><published>2008-11-07T12:38:00.000-08:00</published><updated>2008-11-07T12:41:11.606-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='listbox'/><title type='text'>Selecting all Items in a ListBox in VB.NET</title><content type='html'>It seems to me like there should be a method that would select or deselect all items in a listbox, but there is not.   Here is a simple sub to accomplish this task:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Public Sub SelectAllListBoxItems(ByVal lv As ListBox, &lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;ByVal selected As Boolean)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;For i As Integer = 0 To lv.Items.Count - 1&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;ListBoxValidations.SetSelected(i, selected)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Next&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;End Sub&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-8615936250537474939?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/8615936250537474939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=8615936250537474939' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8615936250537474939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8615936250537474939'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/11/selecting-all-items-in-listbox-in-vbnet.html' title='Selecting all Items in a ListBox in VB.NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-8758581622863337285</id><published>2008-10-25T14:13:00.000-07:00</published><updated>2008-10-25T14:21:30.889-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rich Text'/><category scheme='http://www.blogger.com/atom/ns#' term='Syntax Highlighting'/><title type='text'>Parsing text Syntax Highlighting in a Rich Text Box</title><content type='html'>Here is an interesting posting on how to format text in a Rich Text Box control so that it does Syntax Highlighing:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.c-sharpcorner.com/uploadfile/duncanharris/syntaxhighlightinrichtextboxp112012005050840am/syntaxhighlightinrichtextboxp1.aspx"&gt;http://www.c-sharpcorner.com/uploadfile/duncanharris/syntaxhighlightinrichtextboxp112012005050840am/syntaxhighlightinrichtextboxp1.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-8758581622863337285?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/8758581622863337285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=8758581622863337285' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8758581622863337285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8758581622863337285'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/10/parsing-text-syntax-highlighting-in.html' title='Parsing text Syntax Highlighting in a Rich Text Box'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-4053396939105248882</id><published>2008-10-24T14:42:00.000-07:00</published><updated>2008-10-24T14:44:06.108-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Text'/><title type='text'>Great Info on Working with Text in .NET</title><content type='html'>The following link shows how to Align Text, Clip Text, Wrap Text, Transform Text, and Shade Text in .NET:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.devx.com/dotnet/Article/33464/1954"&gt;http://www.devx.com/dotnet/Article/33464/1954&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-4053396939105248882?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/4053396939105248882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=4053396939105248882' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/4053396939105248882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/4053396939105248882'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/10/great-info-on-working-with-text-in-net.html' title='Great Info on Working with Text in .NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-6796624201755948341</id><published>2008-10-24T10:48:00.000-07:00</published><updated>2008-10-25T14:13:46.472-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Large Fonts'/><category scheme='http://www.blogger.com/atom/ns#' term='TrueType'/><category scheme='http://www.blogger.com/atom/ns#' term='Bitmap'/><title type='text'>Converting a TrueType Font Character into a Bitmap</title><content type='html'>Here is an excellent article on creating a bitmap from a TrueType Font Character. If you want to create a symbol selection dialog with a ListView, these routines can generate the Bitmap image for the listview items.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/GDI-plus/TTF_to_bitmap_convert.aspx"&gt;http://www.codeproject.com/KB/GDI-plus/TTF_to_bitmap_convert.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This article did more than I needed.  I only wanted to create the images for a ListView for all of the characters in a TrueType font.  I have boiled down the code from the above article to the following:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Private Sub UpdateSymbolList(fontName as String)&lt;br /&gt;&lt;br /&gt;ListView1.Items.Clear()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;For i As Integer = 0 To 255&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;&lt;br /&gt;Dim bm As Bitmap = ConvertChar(fontName, i, Color.Blue, 32, 32, 20)&lt;br /&gt;ImageList1.Images.Add(i.ToString, bm)&lt;br /&gt;&lt;br /&gt;Next&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;ListView1.LargeImageList = ImageList1&lt;br /&gt;ListView1.SmallImageList = ImageList1&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;For i As Integer = 0 To 255&lt;br /&gt;Dim lvi As New ListViewItem&lt;br /&gt;lvi.Text = i.ToString&lt;br /&gt;lvi.ImageKey = i.ToString&lt;br /&gt; ListView1.Items.Add(lvi)&lt;br /&gt; Next&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Public Shared Function ConvertChar(ByVal fontName As String, _&lt;br /&gt;ByVal charCode As Integer, _&lt;br /&gt;ByVal color As Color, _&lt;br /&gt;ByVal bitmapWidth As Integer, _&lt;br /&gt;ByVal bitmapHeight As Integer, _&lt;br /&gt;ByVal characterSize As Single) As Bitmap&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Dim charToDraw As Char = Chr(charCode)&lt;br /&gt;Dim bitmap As New Bitmap(bitmapWidth, bitmapHeight)&lt;br /&gt;Dim g As Graphics = Graphics.FromImage(bitmap)&lt;br /&gt;Dim fnt As Font = New Font(fontName, characterSize, FontStyle.Regular)&lt;br /&gt;Dim textFormat As New StringFormat()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;textFormat.Alignment = StringAlignment.Center&lt;br /&gt;textFormat.LineAlignment = StringAlignment.Center&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;g.DrawString(charToDraw.ToString, fnt, New SolidBrush(color), New RectangleF(0, 1, bitmapWidth, bitmapHeight), textFormat)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;g.DrawRectangle(New Pen(Drawing.Color.Black, 1), New Rectangle(0, 0, bitmapWidth - 1, bitmapHeight - 1))&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Return bitmap&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;End Function&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-6796624201755948341?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/6796624201755948341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=6796624201755948341' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/6796624201755948341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/6796624201755948341'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/10/converting-truetype-font-character-into.html' title='Converting a TrueType Font Character into a Bitmap'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-9010165015150489859</id><published>2008-10-21T12:55:00.001-07:00</published><updated>2008-10-21T17:21:01.538-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Option Strict'/><category scheme='http://www.blogger.com/atom/ns#' term='Late Binding'/><category scheme='http://www.blogger.com/atom/ns#' term='Dotfuscator'/><category scheme='http://www.blogger.com/atom/ns#' term='Casting'/><title type='text'>Option Strict On causes Disallows Late Binding Error when getting Variant Array from a COM Object</title><content type='html'>I have several ActiveX controls that I use with .NET. Generally, there are not too many problems using them with .NET, but I have come across one error that was difficult (for me) to solve.&lt;br /&gt;&lt;br /&gt;Since the ActiveX controls were originally written for VB6, they return Variants and arrays are returned as Variants of Variants. This is all fine because .NET has an Object type to work with the variants. As a rule, however, I use Option Strict On because if you don't use this option, Dotfuscator will really cause problems without letting you know in advance. But the catch is that with Option Strict on, you cannot do something like the following:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Dim varArray as Object&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Dim count as Integer&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;SomeComObject.GetList( varArray, count )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;For i as Integer = 0 to count - 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Debug.WriteLine( varArray(i).ToString )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Next&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;varArray will return list of integers, but as a Variant Array of Variant Integer values.&lt;br /&gt;&lt;br /&gt;The code above will not work with Option Strict On because the varArray(i) is late bound and this is not allowed. My first though was to try:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Dim val as integer = CType( varArray(i), Integer)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The above code does not work or any similar cast.&lt;br /&gt;&lt;br /&gt;The only solution I have discovered (and there are probably others) is to cast the Variant array as an Object array like:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Dim vArray() as Object = CType( varArray, Object())&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Then the vArray is a Object Array and can be further cast to other types without catching on the Option Strict On. For example:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Dim catList As Object = Nothing&lt;br /&gt;Dim offsetList As Object = Nothing&lt;br /&gt;Dim filterList As Object = Nothing&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;&lt;br /&gt;While viewObj.GetElementsInRangeFetch(1000, catList, offsetList, filterList, blockCount)&lt;br /&gt;&lt;br /&gt;Dim cList() As Object = CType(catList, Object())&lt;br /&gt;Dim oList() As Object = CType(offsetList, Object())&lt;br /&gt;Dim fList() As Object = CType(filterList, Object())&lt;br /&gt;&lt;br /&gt;For j As Integer = 0 To blockCount - 1&lt;br /&gt;ProcessFeature(CInt(cList(j)), CInt(oList(j)), CInt(fList(j)))&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;catList = Nothing&lt;br /&gt;offsetList = Nothing&lt;br /&gt;filterList = Nothing&lt;br /&gt;&lt;br /&gt;End While&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;This may not be the cleanest solution, but it does work and allow the Option Strict setting to be left on.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-9010165015150489859?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/9010165015150489859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=9010165015150489859' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/9010165015150489859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/9010165015150489859'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/10/option-strict-on-causes-disallows-late_21.html' title='Option Strict On causes Disallows Late Binding Error when getting Variant Array from a COM Object'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-1607827888738625081</id><published>2008-10-21T12:55:00.000-07:00</published><updated>2008-10-21T14:31:07.784-07:00</updated><title type='text'>Option Strict On causes Disallows Late Binding Error when getting Variant Array from a COM Object</title><content type='html'>I have several ActiveX controls that I use with .NET. Generally, there are not too many problems using them with .NET, but I have come across one error that was difficult (for me) to solve.&lt;br /&gt;&lt;br /&gt;Since the ActiveX controls were originally written for VB6, they return Variants and arrays are returned as Variants of Variants. This is all fine because .NET has an Object type to work with the variants. As a rule, however, I use Option Strict On because if you don't use this option, Dotfuscator will really cause problems without letting you know in advance. But the catch is that with Option Strict on, you cannot do something like the following:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Dim varArray as Object&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Dim count as Integer&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;SomeComObject.GetList( varArray, count )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;For i as Integer = 0 to count - 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Debug.WriteLine( varArray(i).ToString )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Next&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;varArray will return list of integers, but as a Variant Array of Variant Integer values.&lt;br /&gt;&lt;br /&gt;The code above will not work with Option Strict On because the varArray(i) is late bound and this is not allowed. My first though was to try:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Dim val as integer = CType( varArray(i), Integer)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This doesn't work or any similar cast.&lt;br /&gt;&lt;br /&gt;The only way solution (and there are probably others) is to cast the Variant array as an Integer array like:&lt;br /&gt;&lt;br /&gt;Dim vArray() as Integer = CType( varArray, Integer())&lt;br /&gt;&lt;br /&gt;Then the vArray is a regular Integer Array.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-1607827888738625081?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/1607827888738625081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=1607827888738625081' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1607827888738625081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1607827888738625081'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/10/option-strict-on-causes-disallows-late.html' title='Option Strict On causes Disallows Late Binding Error when getting Variant Array from a COM Object'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-3894892641669091219</id><published>2008-10-19T14:13:00.000-07:00</published><updated>2008-10-19T14:17:36.405-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DataGridView'/><category scheme='http://www.blogger.com/atom/ns#' term='fit'/><title type='text'>Auto Fit Columns in a DataGridView</title><content type='html'>I have posted a function to auto-fit the columns in a ListView &lt;a href="http://dotnetref.blogspot.com/2007/06/how-to-fit-all-columns-in-listview.html"&gt;before&lt;/a&gt;.  However, when I wanted to do the same thing for a DataGridView, the task is a little different (yet easier):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-3894892641669091219?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/3894892641669091219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=3894892641669091219' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3894892641669091219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3894892641669091219'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/10/auto-fit-columns-in-datagridview.html' title='Auto Fit Columns in a DataGridView'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-2816558696936765846</id><published>2008-10-16T15:29:00.000-07:00</published><updated>2008-10-16T15:36:11.147-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='registry'/><title type='text'>Basic Registry Operations with VB.NET</title><content type='html'>Reading and Writing to the Registry in VB.NET is fairly simple, especially when compared to using C++.   However, it can still be a little difficult to get going.   Here are 3 functions to perform the basic Registry operations: Read, Write, and Delete.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Examples Using the Functions:&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Dim value As String = _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;GetRegistryValue(Registry.LocalMachine, _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;"SOFTWARE\CompanyName\ApplicationName", "License")&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;SetRegistryValue(Registry.LocalMachine, _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;"SOFTWARE\CompanyName\ApplicationName", _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;"License", "value")&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;DeleteRegistryValue(Registry.LocalMachine, _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;"SOFTWARE\CompanyName\ApplicationName", "License")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Read a Registry Value&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Public Function GetRegistryValue(ByVal regKey As RegistryKey, _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;ByVal subKey As String, ByVal valueName As String) As String&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Dim value As String = ""&lt;br /&gt;Dim registryKey As RegistryKey = regKey&lt;br /&gt;Dim registrySubKey As RegistryKey&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;registrySubKey = registryKey.OpenSubKey(subKey)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;If registrySubKey IsNot Nothing Then&lt;br /&gt;Try&lt;br /&gt;value = registrySubKey.GetValue(valueName).ToString&lt;br /&gt;Catch ex As Exception&lt;br /&gt;value = ""&lt;br /&gt;End Try&lt;br /&gt;registrySubKey.Close()&lt;br /&gt;End If&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;Return value&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;End Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Write a Registry Value&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Public Function SetRegistryValue(ByVal regKey As RegistryKey, _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;ByVal subKey As String, ByVal valueName As String, ByVal value As String) As Boolean&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Dim registryKey As RegistryKey = regKey&lt;br /&gt;Dim registrySubKey As RegistryKey&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;registrySubKey = registryKey.OpenSubKey(subKey, True)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;If registrySubKey Is Nothing Then&lt;br /&gt;registrySubKey = registryKey.CreateSubKey(subKey, RegistryKeyPermissionCheck.ReadWriteSubTree)&lt;br /&gt;End If&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;If registrySubKey IsNot Nothing Then&lt;br /&gt;registrySubKey.SetValue(valueName, value)&lt;br /&gt;registrySubKey.Close()&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Return True&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;End If&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Return False&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;End Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Delete a Registry Value&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Public Function DeleteRegistryValue(ByVal regKey As RegistryKey, _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;ByVal subKey As String, ByVal valueName As String) As Boolean&lt;br /&gt;&lt;br /&gt;Dim value As String = ""&lt;br /&gt;Dim registryKey As RegistryKey = regKey&lt;br /&gt;Dim registrySubKey As RegistryKey&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;registrySubKey = registryKey.OpenSubKey(subKey, True)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;If registrySubKey IsNot Nothing Then&lt;br /&gt;Dim retValue As Boolean = True&lt;br /&gt;Try&lt;br /&gt;registrySubKey.DeleteValue(valueName)&lt;br /&gt;Catch ex As Exception&lt;br /&gt;retValue = False&lt;br /&gt;End Try&lt;br /&gt;registrySubKey.Close()&lt;br /&gt;Return retValue&lt;br /&gt;End If&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Return False&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;End Function&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-2816558696936765846?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/2816558696936765846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=2816558696936765846' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2816558696936765846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2816558696936765846'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/10/basic-registry-operations-with-vbnet.html' title='Basic Registry Operations with VB.NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-1832159937417119656</id><published>2008-10-03T14:07:00.000-07:00</published><updated>2008-10-03T14:10:17.209-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FTP'/><title type='text'>FTP Upload and Download in VB.NET and C#</title><content type='html'>The following site has C# code to upload and download a file via FTP in C#:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeguru.com/csharp/csharp/cs_internet/desktopapplications/article.php/c13163"&gt;http://www.codeguru.com/csharp/csharp/cs_internet/desktopapplications/article.php/c13163&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can take the C# code and paste into the converter at the following web site to get VB.NET:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.developerfusion.com/tools/convert/csharp-to-vb/"&gt;http://www.developerfusion.com/tools/convert/csharp-to-vb/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-1832159937417119656?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/1832159937417119656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=1832159937417119656' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1832159937417119656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1832159937417119656'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/10/ftp-upload-and-download-in-vbnet-and-c.html' title='FTP Upload and Download in VB.NET and C#'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-8546401960722618257</id><published>2008-10-02T16:00:00.000-07:00</published><updated>2008-10-02T16:20:10.309-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Device Name'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='Owner Name'/><title type='text'>Getting Windows Mobile Owner Name and Device Name</title><content type='html'>It is sometimes useful to get the &lt;strong&gt;Owner Name&lt;/strong&gt; and/or the &lt;strong&gt;Device Name&lt;/strong&gt; of the Windows Mobile device. If you are wanting a Device Id, then see this &lt;a href="http://dotnetref.blogspot.com/search?q=device+id"&gt;posting&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;There are different ways to get the Owner Name and Device Name:&lt;br /&gt;&lt;br /&gt;For &lt;strong&gt;Owner Name&lt;/strong&gt;, add the following reference to your project:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;Microsoft.WindowsMobileMicrosoft.WindowsMobile.Status&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Then in your code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;Imports Microsoft.WindowsMobile.Status&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;MessageBox.Show(SystemState.OwnerName)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;More info at:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=46306"&gt;http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=46306&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To get the &lt;strong&gt;Device Name&lt;/strong&gt; (which is what you find under Start/Settings/System Tab/About), you simply have to say:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;MessageBox.Show(System.Net.Dns.GetHostName())&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For more Info:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.net.dns.gethostname.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.net.dns.gethostname.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-8546401960722618257?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/8546401960722618257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=8546401960722618257' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8546401960722618257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8546401960722618257'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/10/getting-windows-mobile-owner-name-and.html' title='Getting Windows Mobile Owner Name and Device Name'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-836932041891262210</id><published>2008-09-24T02:26:00.000-07:00</published><updated>2008-10-02T16:21:28.999-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='POOM'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Mobile'/><title type='text'>Unresolved Externals when using POOM in VC++</title><content type='html'>I found several postings when searching for a solution to compiling a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;POOM&lt;/span&gt; app that &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;errors&lt;/span&gt; out with Unresolved External Symbol &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;CLSID&lt;/span&gt;_Application and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;IID&lt;/span&gt;_&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;IPOutlookApp&lt;/span&gt;. Only one of the solutions I found worked for me using Visual Studio 2008 C++:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.tech-archive.net/Archive/PocketPC/microsoft.public.pocketpc.developer/2006-03/msg00236.html"&gt;http://www.tech-archive.net/Archive/PocketPC/microsoft.public.pocketpc.developer/2006-03/msg00236.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The trick is to use:&lt;br /&gt;&lt;br /&gt;#include "initguid.h"&lt;br /&gt;#include "pimstore.h"&lt;br /&gt;&lt;br /&gt;at the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;begining&lt;/span&gt; of the .&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;cpp&lt;/span&gt; file. The &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;initguid&lt;/span&gt;.h is the item that fixes the problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-836932041891262210?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/836932041891262210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=836932041891262210' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/836932041891262210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/836932041891262210'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/09/unresolved-externals-when-using-poom-in.html' title='Unresolved Externals when using POOM in VC++'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-9188671754099562786</id><published>2008-09-06T16:37:00.000-07:00</published><updated>2008-09-06T16:41:48.322-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='file version'/><category scheme='http://www.blogger.com/atom/ns#' term='installer'/><category scheme='http://www.blogger.com/atom/ns#' term='VC++'/><title type='text'>Incrementing FileVersion for VC++</title><content type='html'>In a recent posting, I talked about solutions to incrementing the FileVersion in Visual Studio .NET for VB.NET and C# project.   This need was motivated by the changes in VS2008 that requires a FileVersion to be changed before the Windows Installer will replace a file.&lt;br /&gt;&lt;br /&gt;Some of my projects have Native DLLs that are compiled in VS 2008's VC++ compiler.  These files has the same problem with the installer, yet the previous solution (&lt;a href="http://dotnetref.blogspot.com/2008/09/auto-incrementing-file-version-in.html"&gt;http://dotnetref.blogspot.com/2008/09/auto-incrementing-file-version-in.html&lt;/a&gt;) did not address.&lt;br /&gt;&lt;br /&gt;I found this very handy Add-In that works well with VS2008 (and previous versions) that will increment the FileVersion (Product Version, etc.) in the VC++ projects resource file.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeguru.com/cpp/v-s/devstudio_macros/visualstudionet/article.php/c14981"&gt;http://www.codeguru.com/cpp/v-s/devstudio_macros/visualstudionet/article.php/c14981&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-9188671754099562786?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/9188671754099562786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=9188671754099562786' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/9188671754099562786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/9188671754099562786'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/09/incrementing-fileversion-for-vc.html' title='Incrementing FileVersion for VC++'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-660948183195338642</id><published>2008-09-05T08:56:00.000-07:00</published><updated>2008-09-05T09:19:05.816-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Setup Projects'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><title type='text'>Visual Studio 2008 Setup Project always requiring .NET Framework 3.5 even when 2.0 is Targeted</title><content type='html'>I am slowly upgrading my projects from VS2005 to VS2008. I had a puzzling problem with the Setup Projects always requiring the .NET Framework 3.5 even when the Setup Project is targeted to 2.0 and the application it is delivering is using .NET Framework 2.0.&lt;br /&gt;&lt;br /&gt;There are several posting on the the internet about solving this problem. It basically requires you to go to View/Editor/Launch Condition and change the .NET Framework to the version you desire. The Project properties for your setup project are a bit misleading when they have no affect on this problem.&lt;br /&gt;&lt;br /&gt;Read these posting for more detailed explanations:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://impressionsoft.blogspot.com/2008/03/visual-studio-2008-setup-project-and.html"&gt;http://impressionsoft.blogspot.com/2008/03/visual-studio-2008-setup-project-and.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/cschotte/archive/2007/08/15/vs2008-launch-conditions-and-prerequisites.aspx"&gt;http://blogs.msdn.com/cschotte/archive/2007/08/15/vs2008-launch-conditions-and-prerequisites.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-660948183195338642?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/660948183195338642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=660948183195338642' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/660948183195338642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/660948183195338642'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/09/visual-studio-2008-setup-project-always.html' title='Visual Studio 2008 Setup Project always requiring .NET Framework 3.5 even when 2.0 is Targeted'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-7657897437301077526</id><published>2008-09-04T14:31:00.000-07:00</published><updated>2011-06-22T07:38:00.165-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='file version'/><category scheme='http://www.blogger.com/atom/ns#' term='auto-increment'/><category scheme='http://www.blogger.com/atom/ns#' term='installer'/><title type='text'>Auto-Incrementing the File Version in Visual Studio 2005 and 2008</title><content type='html'>&lt;span style="font-style: italic;"&gt;*** Update - Since I made this post, I have found another tool that is simpler to use and also work with VS2010.   See this &lt;/span&gt;&lt;a style="font-style: italic;" href="http://autobuildversion.codeplex.com/"&gt;http://autobuildversion.codeplex.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;If this doesn't work for you, then you may with to view the info below:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Setup and Deployment (Windows Installer) has a significant change between VS2005 and VS2008. In VS2008, a file will not be updated by the installer if the File Version has not changed. This pretty much breaks all of the VS2005 Installations I have created. There are various reasons for this, and I will let you read for yourself:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.vstudio.general&amp;amp;tid=c4c56abf-9bde-45ed-8737-90cf90514d89&amp;amp;cat=&amp;amp;lang=&amp;amp;cr=&amp;amp;sloc=&amp;amp;p=1"&gt;http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.vstudio.general&amp;amp;tid=c4c56abf-9bde-45ed-8737-90cf90514d89&amp;amp;cat=&amp;amp;lang=&amp;amp;cr=&amp;amp;sloc=&amp;amp;p=1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The solution to the problem is to increment the File Version (under Project Properties/Assembly Information) between Setup (.msi) builds. So, before every setup you create, you have to go manually update the File Version so the setup will update the file. Before, you just had to update the Version property in the Installer Project (and let it update the Product Code); you still have to do this (which is probably acceptable). I thought there must be someway to automatically increment the File Version since this change to the Installer breaks all of my setups; however, there is not (that I can find anyway). The only workable solution I have found is to use a BuildTask that updates the AssemblyInfo.vb (or AssemblyInfo.cs) before each build is made. This solution is a really complicated for something that was a checkbox in VB6 (as someone pointed out).&lt;br /&gt;&lt;br /&gt;Here is the solution I tried and it does work:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/dotnet/Auto_Increment_Version.aspx"&gt;http://www.codeproject.com/KB/dotnet/Auto_Increment_Version.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is a similar solution:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://weblogs.asp.net/bradleyb/archive/2005/12/02/432150.aspx"&gt;http://weblogs.asp.net/bradleyb/archive/2005/12/02/432150.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-7657897437301077526?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/7657897437301077526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=7657897437301077526' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/7657897437301077526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/7657897437301077526'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/09/auto-incrementing-file-version-in.html' title='Auto-Incrementing the File Version in Visual Studio 2005 and 2008'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-798783684499444347</id><published>2008-09-03T13:56:00.000-07:00</published><updated>2008-10-05T12:52:46.258-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='launching'/><category scheme='http://www.blogger.com/atom/ns#' term='Internet Explorer'/><category scheme='http://www.blogger.com/atom/ns#' term='default browser'/><title type='text'>Launch Internet Explorer or Default Browser from VB.NET (or C#)</title><content type='html'>I found several ways to launch IE from VB.NET, but the following approach appears to be the simplest:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Process.Start("IExplore.exe", "&lt;/span&gt;&lt;a href="http://dotnetref.blogspot.com/"&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;http://dotnetref.blogspot.com&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#3333ff;"&gt;"&lt;span style="font-family:courier new;font-size:85%;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;More information at:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bytes.com/forum/thread413370.html"&gt;http://bytes.com/forum/thread413370.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you want to launch the default browser (such as Firefox), it may be easiest to just say the following:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Process.Start("&lt;/span&gt;&lt;a href="http://dotnetref.blogspot.com/"&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;http://dotnetref.blogspot.com&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;") &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;and let the Shell do the work of deciding th default browser.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For more info on this approach:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.vbforums.com/showthread.php?t=323257"&gt;http://www.vbforums.com/showthread.php?t=323257&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The C# approach is not any different, just use the approprate syntax.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-798783684499444347?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/798783684499444347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=798783684499444347' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/798783684499444347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/798783684499444347'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/09/launch-internet-explorer-from-vbnet.html' title='Launch Internet Explorer or Default Browser from VB.NET (or C#)'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-9012589004318054261</id><published>2008-08-28T10:36:00.000-07:00</published><updated>2008-08-28T10:44:33.520-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='device Id'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Mobile'/><title type='text'>Getting a Device ID using the Compact Framework</title><content type='html'>Here are a couple of approaches I found for getting a Device ID using the compact framework. Both are lengthy solutions to something that should probably be built into platform.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms172516.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms172516.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa446562.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa446562.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/jehance/archive/2004/07/12/181067.aspx"&gt;http://blogs.msdn.com/jehance/archive/2004/07/12/181067.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-9012589004318054261?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/9012589004318054261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=9012589004318054261' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/9012589004318054261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/9012589004318054261'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/08/getting-device-id-using-compact.html' title='Getting a Device ID using the Compact Framework'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-7630353443601728148</id><published>2008-08-28T08:11:00.000-07:00</published><updated>2008-08-28T08:28:23.170-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PInvoke'/><category scheme='http://www.blogger.com/atom/ns#' term='Escape'/><title type='text'>How to do a CDC.Escape() in .NET</title><content type='html'>There may be ways around using the old CDC Escape function from &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;MFC&lt;/span&gt;, but when you are porting C++ to C#, it is nice to just call the same Win32&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;api&lt;/span&gt; functions that you were using before. For printing, I used the Escape function to get information about the printer, but since this method can return a Point structure the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;PInvoke&lt;/span&gt; was more difficult. Here is the code necessary to call the Escape method:&lt;br /&gt;&lt;br /&gt;First you need the POINT structure defined in .NET:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;[&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;StructLayout&lt;/span&gt;(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;LayoutKind&lt;/span&gt;.Sequential)]&lt;br /&gt;public &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;struct&lt;/span&gt; POINT&lt;br /&gt;{&lt;br /&gt;public int X;&lt;br /&gt;public int Y;&lt;br /&gt;public POINT(int x, int y)&lt;br /&gt;{&lt;br /&gt;this.X = x;&lt;br /&gt;this.Y = y;&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then you need the Signature for the Escape method ):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color:#3333ff;"&gt;[&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;DllImport&lt;/span&gt;("&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;gdi&lt;/span&gt;32.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;dll&lt;/span&gt;")]&lt;br /&gt;private static &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;extern&lt;/span&gt; int Escape(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;IntPtr&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;hdc&lt;/span&gt;, int &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;nEscape&lt;/span&gt;, int &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;cbInput&lt;/span&gt;, string &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;lpvInData&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;IntPtr&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;lpvOutData&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There are also the constants that are sent as the Escape type (I just provide a couple of example that return a Point structure):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;private &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;const&lt;/span&gt; int &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;GETPRINTINGOFFSET&lt;/span&gt; = 13;&lt;br /&gt;private &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;const&lt;/span&gt; int &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;GETPHYSPAGESIZE&lt;/span&gt; = 12;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then you can call the method. You can get the Graphics object from various places, but you need the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;HDc&lt;/span&gt; from it regardless:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;IntPtr&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;hDC&lt;/span&gt; = e.Graphics.GetHdc();&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;IntPtr&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;pnt&lt;/span&gt;;&lt;br /&gt;long stat;&lt;br /&gt;POINT &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;printingOffsetPoint&lt;/span&gt; = new POINT(0,0);&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;pnt&lt;/span&gt; = Marshal.AllocHGlobal(Marshal.SizeOf(printingOffsetPoint));&lt;br /&gt;Marshal.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;StructureToPtr&lt;/span&gt;(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;printingOffsetPoint&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;pnt&lt;/span&gt;, false);&lt;br /&gt;stat = Escape(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;hDC&lt;/span&gt;,&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;GETPRINTINGOFFSET&lt;/span&gt;, 0, null, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;pnt&lt;/span&gt;);&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;printingOffsetPoint&lt;/span&gt; = (POINT)Marshal.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;PtrToStructure&lt;/span&gt;(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;pnt&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;typeof&lt;/span&gt;(POINT));&lt;br /&gt;Marshal.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;FreeHGlobal&lt;/span&gt;(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;pnt&lt;/span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3366ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3366ff;"&gt;POINT &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_41"&gt;physPageSizePoint&lt;/span&gt; = new POINT(0, 0);&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_42"&gt;pnt&lt;/span&gt; = Marshal.AllocHGlobal(Marshal.SizeOf(physPageSizePoint));&lt;br /&gt;Marshal.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_43"&gt;StructureToPtr&lt;/span&gt;(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_44"&gt;physPageSizePoint&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_45"&gt;pnt&lt;/span&gt;, false);&lt;br /&gt;stat = Escape(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_46"&gt;hDC&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_47"&gt;GETPHYSPAGESIZE&lt;/span&gt;, 0, null, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_48"&gt;pnt&lt;/span&gt;);&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_50"&gt;physPageSizePoint&lt;/span&gt; = (POINT)Marshal.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_51"&gt;PtrToStructure&lt;/span&gt;(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_52"&gt;pnt&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_53"&gt;typeof&lt;/span&gt;(POINT));&lt;br /&gt;Marshal.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_54"&gt;FreeHGlobal&lt;/span&gt;(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_55"&gt;pnt&lt;/span&gt;);&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-7630353443601728148?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/7630353443601728148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=7630353443601728148' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/7630353443601728148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/7630353443601728148'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/08/how-to-do-cdcescape-in-net.html' title='How to do a CDC.Escape() in .NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-301235326851236956</id><published>2008-08-07T10:13:00.000-07:00</published><updated>2008-08-07T10:21:52.901-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Status Bar'/><category scheme='http://www.blogger.com/atom/ns#' term='Menu'/><category scheme='http://www.blogger.com/atom/ns#' term='Fill'/><category scheme='http://www.blogger.com/atom/ns#' term='Dock'/><title type='text'>Using Dock Fill on a Control when you have a Menu and/or Status Bar</title><content type='html'>I have long been frustrated in Visual Studio .NET when I try to use a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;control's&lt;/span&gt; Dock property set to Fill and also have a Menu or Status bar on the same form.   The Docked control typically fills to the form and is not the right size (not accounting for the size of the Menu or Status bar).&lt;br /&gt;&lt;br /&gt;It turns out that there is a very simple (but not very obvious) solution to this problem.  Taken from Alex Fr's response to a &lt;a href="http://www.codeproject.com/KB/miscctrl/resize_form.aspx"&gt;comment &lt;/a&gt;on a similar problem:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;"Actually, all you need to do is &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;rightclick&lt;/span&gt; the panel and choose "bring to front", the dock layout logic handles each component in order so when it reaches your panel first it &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;doesnt&lt;/span&gt; know it has other components that fill up other parts of the container with their docking settings. "&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Just make sure the Docked control is in front of the menu and status bar and it works as you would expect.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-301235326851236956?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/301235326851236956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=301235326851236956' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/301235326851236956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/301235326851236956'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/08/using-dock-fill-on-control-when-you.html' title='Using Dock Fill on a Control when you have a Menu and/or Status Bar'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-1342535038059713404</id><published>2008-08-03T08:59:00.000-07:00</published><updated>2008-08-03T09:02:06.715-07:00</updated><title type='text'>Seeing what color the .NET Color names actually are</title><content type='html'>I found a very useful .NET Color reference at the following web site.  If you want to compare AliceBlue, DodgerBlue, and SteelBlue, here is an easy way to do it:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.opinionatedgeek.com/DotNet/Tools/Colors/default.aspx"&gt;http://www.opinionatedgeek.com/DotNet/Tools/Colors/default.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-1342535038059713404?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/1342535038059713404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=1342535038059713404' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1342535038059713404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/1342535038059713404'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/08/seeing-what-color-net-color-names.html' title='Seeing what color the .NET Color names actually are'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-6613918281061852297</id><published>2008-07-30T14:14:00.000-07:00</published><updated>2008-07-30T14:22:28.101-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Icon'/><category scheme='http://www.blogger.com/atom/ns#' term='Resources'/><category scheme='http://www.blogger.com/atom/ns#' term='Form Icon'/><title type='text'>Setting the Form Icon to an Application Resource in VB.NET</title><content type='html'>I have an application with a main form and many dialogs.  I want the main form and all of the dialogs to use the same icon in the forms' title bars.  So, instead of defining the Icon property on each form, I have created an application resource and added a line of code to each Form_Load method.&lt;br /&gt;&lt;br /&gt;First, add an Icon to your Project Resources (Project/Properties then on the Resource tab). Remember the name of the icon resource you create.  Mine is AppIcon in this example.&lt;br /&gt;&lt;br /&gt;Then for each Form_Load method in the VB.NET app (for the main form and each dialog's form), I add the following:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#000099;"&gt;Me.Icon = My.Resources.AppIcon&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There may be even better ways to do this, but this is the simplest I have found so far.&lt;br /&gt;&lt;br /&gt;For more information on using resources, see:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://visualbasic.about.com/od/usingvbnet/a/ResVBNET.htm"&gt;http://visualbasic.about.com/od/usingvbnet/a/ResVBNET.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-6613918281061852297?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/6613918281061852297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=6613918281061852297' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/6613918281061852297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/6613918281061852297'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/07/setting-form-icon-to-application.html' title='Setting the Form Icon to an Application Resource in VB.NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-3900746602305891027</id><published>2008-07-29T14:29:00.000-07:00</published><updated>2008-07-29T14:34:34.749-07:00</updated><title type='text'>Keeping a Nonmodal form on top of App, but not on top of Everything</title><content type='html'>It took me a while to figure this one out, but the solution is pretty simple.&lt;br /&gt;&lt;br /&gt;I want to keep a nonmodal form on top of my main app form.  I have tried using:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;Dlg.TopMost = True&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;in the nonmodal form (Dlg), but this approach keeps the form on top of everything, not just my main app form.&lt;br /&gt;&lt;br /&gt;The solution is:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;Dlg.Owner = Me                 ' Me is the main app form&lt;br /&gt;Dlg.TopMost = False&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;More info can be found at:&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;color:#3333ff;"&gt;&lt;a href="http://www.syncfusion.com/faq/windowsforms/faq_c95c.aspx#q975q"&gt;http://www.syncfusion.com/faq/windowsforms/faq_c95c.aspx#q975q&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;color:#3333ff;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-3900746602305891027?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/3900746602305891027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=3900746602305891027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3900746602305891027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3900746602305891027'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/07/keeping-nonmodal-form-on-top-of-app-but.html' title='Keeping a Nonmodal form on top of App, but not on top of Everything'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-3706365158909125910</id><published>2008-07-24T09:50:00.000-07:00</published><updated>2008-07-24T10:06:02.064-07:00</updated><title type='text'>Changing a Control's Font Size at Runtime in VB.NET</title><content type='html'>If you have a control that is using a font with size 8.25 (which was defined at design-time), then at runtime you want to change it to a different size (such as 12), you cannot simply say:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;ctrl.Font.Size = 12&lt;/span&gt; &lt;/span&gt;&lt;span style="color:#000000;"&gt;(this will not work - &lt;em&gt;Property Size is Read-Only&lt;/em&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;However, you can replace the whole font:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;ctrl.Font = new Font(ctrl.Font.FontFamily, 12, ctrl.Font.Style)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;span style="color:#000000;"&gt;For more info and examples in C#, see: &lt;/span&gt;&lt;a href="http://bytes.com/forum/thread261450.html"&gt;http://bytes.com/forum/thread261450.html&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-3706365158909125910?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/3706365158909125910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=3706365158909125910' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3706365158909125910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3706365158909125910'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/07/changing-controls-font-size-at-runtime.html' title='Changing a Control&apos;s Font Size at Runtime in VB.NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-7646447167757373869</id><published>2008-06-29T08:50:00.000-07:00</published><updated>2008-06-29T10:08:20.691-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Semi-Transparent Fill'/><category scheme='http://www.blogger.com/atom/ns#' term='SolidBrush'/><title type='text'>Using Brushes with Semi-Transparent Color</title><content type='html'>Filling a Rectangle, Ellipse, Shape, etc. with a semi-transparent fill is done by using a SolidBrush with a Alpha value somewhere between solid and transparent.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;C#:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Color col = Color.FromArgb(75, 100, 100, 100);&lt;br /&gt;SolidBrush b = new SolidBrush(col);&lt;br /&gt;g.FillRectangle(b, 0, 0, this.Width - 1, this.Height - 1);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;VB.NET:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;color:#3333ff;"&gt;Dim col As Color = Color.FromArgb(75, 100, 100, 100)&lt;br /&gt;Dim b As New SolidBrush(col)&lt;br /&gt;g.FillRectangle(b, 0, 0, Me.Width - 1, Me.Height - 1) &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For better examples, go to this link:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.java2s.com/Code/CSharp/2D-Graphics/Filledwiththesemitransparentandtransparentcolor.htm"&gt;http://www.java2s.com/Code/CSharp/2D-Graphics/Filledwiththesemitransparentandtransparentcolor.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-7646447167757373869?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/7646447167757373869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=7646447167757373869' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/7646447167757373869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/7646447167757373869'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/06/using-brushes-with-semi-transparent.html' title='Using Brushes with Semi-Transparent Color'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-3858366704991847515</id><published>2008-06-18T15:57:00.000-07:00</published><updated>2008-06-18T17:17:33.708-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Large Fonts'/><category scheme='http://www.blogger.com/atom/ns#' term='SplitContainer'/><category scheme='http://www.blogger.com/atom/ns#' term='Anchor'/><title type='text'>Disappearing Controls in the Left SplitContainer Panel when using Large Fonts</title><content type='html'>I have been experiencing a strange problem that I have finally confirmed as a bug in the .NET Framework 2.0. If you are using a &lt;strong&gt;SplitContainter&lt;/strong&gt; and place controls in your &lt;strong&gt;Left&lt;/strong&gt; panel, then if you anchor those controls to the Right or the Bottom, they will disappear when you run the app on a machine that is using &lt;strong&gt;Large Fonts&lt;/strong&gt;. My controls happen to all be in a group box, but I don't think that matters. The controls disappear because the anchor is setting the height and/or width to 0 and they are not visible. If you can drag the size wide or tall enough, the controls will start to appear, but they scaling is off and the anchor is not working correctly. If using Small Fonts, this problem does not exists.&lt;br /&gt;&lt;br /&gt;I found a few other people with the same problem, but no solutions. I found one suggestion to do a Refresh on the Splitter move event, but this did not help me. My solution has been to adjust the size of the controls in the left panel myself and not rely on the anchor. Please post a comment if you have a better solution to this problem.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.themssforum.com/Winforms/SplitContainer-with/"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-3858366704991847515?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/3858366704991847515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=3858366704991847515' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3858366704991847515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/3858366704991847515'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/06/disappearing-controls-in-left.html' title='Disappearing Controls in the Left SplitContainer Panel when using Large Fonts'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-4480817191190573504</id><published>2008-06-14T15:33:00.000-07:00</published><updated>2011-06-28T14:47:22.990-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='control'/><category scheme='http://www.blogger.com/atom/ns#' term='forecolor'/><category scheme='http://www.blogger.com/atom/ns#' term='KnownColor'/><category scheme='http://www.blogger.com/atom/ns#' term='backcolor'/><title type='text'>Setting BackColor to System Colors (like "Control")</title><content type='html'>It took a little searching to find out how to set the &lt;strong&gt;BackColor&lt;/strong&gt; or &lt;strong&gt;ForeColor&lt;/strong&gt; property of a control to the predefined colors you gets in the Visual Studio Properties window for BackColor's popup color setting on the System tab. For example, I want to set to the BackColor to the "Control" color.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="Vb"&gt;control.BackColor = Color.FromKnownColor(KnownColor.Control)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I found this on:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bytes.com/forum/thread654472.html"&gt;http://bytes.com/forum/thread654472.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-4480817191190573504?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/4480817191190573504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=4480817191190573504' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/4480817191190573504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/4480817191190573504'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/06/setting-backcolor-to-system-colors-like.html' title='Setting BackColor to System Colors (like &quot;Control&quot;)'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-9182886926263892298</id><published>2008-06-12T07:12:00.000-07:00</published><updated>2008-12-08T14:42:41.836-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TechEd 2008'/><title type='text'>TechEd 2008 in Orlando</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_qGIonhYSpfY/SFEwEh0VItI/AAAAAAAAAHo/rayYirrfipA/s1600-h/IMG_0468.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210999098199843538" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_qGIonhYSpfY/SFEwEh0VItI/AAAAAAAAAHo/rayYirrfipA/s320/IMG_0468.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;The TechEd 2008 Deveveloper’s Conference was in Orlando last week. I have always attended MEDC (Mobile and Embedded Developer’s Conference) before, but it has now been merged into TechEd. I believe that I prefer the more focused content of MEDC, but if my only way to get this information is to go to TechEd, then it is not too bad of an alternative. However, there were only 11 Windows Mobile session at TechEd 2008.&lt;br /&gt;&lt;br /&gt;There is always a flavor to a Microsoft conference. I don’t know if this is directed by the powers that be or simply a natural alignment to the new features they are providing (or a combination of both). This year, the flavor definitely tastes of LINQ (Language Integrated Query). LINQ is undeniably an interesting concept that directly integrates SQL-like statement into the language syntax of any .NET language (VB.NET, C#, etc.). What makes this new feature somewhat interesting is that the SQL statements can be applied to data in arrays, enumerable objects, XML, and databases. So, the SQL way of querying a database can now be directly applied to data in your application, not just databases.&lt;br /&gt;&lt;br /&gt;It also appears that most of the new language features we get from Visual Studio 2008 are directly related to LINQ: Anonymous Types, Extension Methods, Lambda Expressions, Implicitly typed locals, and Object Initializers. All of these new features were added just to support LINQ. One session on the Visual Studio 2008 IDE revealed that there wasn’t much added to the IDE because all of the developers were working on LINQ. On the downside, while LINQ does run on Windows Mobile, it will only work with your application data and does not work with SQL CE. There are a lot of things in the Compact Framework I would have rather had than a partially implemented version of LINQ.&lt;br /&gt;&lt;br /&gt;While just about every session had to work LINQ in somehow, there were a couple of other technologies that were shown off. The Windows Presentation Manager (WPF) has developed a good deal since last year and can really produce some spectacular looking demos. The new support in Visual Studio 2008 for WPF is nice, but really seems to be early in its development. All of the WPF sessions seem to highlight a few points: it has great potential, it’s not here yet, and you will need a graphic designer to properly use it. A common phrase I heard in the session is “I’m not a graphic designer, so my WPF doesn’t look very good.” Nevertheless, I still found the Technology compelling enough to pursue. As an aside, Silverlight, which is an offshoot of WPF, came across as a very immature technology. Maybe it will mature quickly.&lt;br /&gt;&lt;br /&gt;The Window Communication Foundation (WCF) was also a popular topic. It is just the extension of Web Services to what it probably should have been in the first place.&lt;br /&gt;&lt;br /&gt;The Windows Workflow Foundation (WF, because WWF was already taken), was new to me and looks really interesting. An oversimplified description of it would be a project type in Visual Studio that lets you create a flow chart or diagram of your business logic and then can add the code behind the items in the diagram. The WF demos were compelling, but I have to question how well it really works in the real world. The demos used very simplistic logic. How well WF scales to a real application would be interesting to know. I think time will tell on this technology. It will become really popular or just disappear.&lt;br /&gt;Another interesting thing about TechEd 2008 is what they didn’t talk about. Normally, these conferences are all using beta versions of something that hasn’t been released. I went to MEDC two years in a row and all they talked about was Whidbey (VS2005). Then it was all about Orcas (VS2008). With the exception of running VS2008 service pack 1 betas and a Silverlight beta, everyone was pretty content with the released software (quite a change from previous conferences). Does this mean there isn’t anything new in the queue or they are just taking a little longer to ramp up to the new stuff.&lt;br /&gt;&lt;br /&gt;All and all, I was pretty pleased with the conference. Visual Studio 2008 looks good enough now to upgrade to (although I may wait until SP1 until I start upgrading all of my projects). Check out the full video and text of Bill Gates’ key: &lt;a href="http://www.microsoft.com/presspass/exec/billg/speeches/2008/06-03teched.mspx"&gt;http://www.microsoft.com/presspass/exec/billg/speeches/2008/06-03teched.mspx&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-9182886926263892298?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/9182886926263892298/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=9182886926263892298' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/9182886926263892298'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/9182886926263892298'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/06/teched-2008-in-orlando.html' title='TechEd 2008 in Orlando'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_qGIonhYSpfY/SFEwEh0VItI/AAAAAAAAAHo/rayYirrfipA/s72-c/IMG_0468.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-8885903424045867089</id><published>2008-06-12T05:23:00.000-07:00</published><updated>2008-06-12T05:25:30.168-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='stylus'/><category scheme='http://www.blogger.com/atom/ns#' term='arrow keys'/><category scheme='http://www.blogger.com/atom/ns#' term='listview'/><category scheme='http://www.blogger.com/atom/ns#' term='listbox'/><category scheme='http://www.blogger.com/atom/ns#' term='selectedindexchanged'/><category scheme='http://www.blogger.com/atom/ns#' term='itemactivate'/><category scheme='http://www.blogger.com/atom/ns#' term='selection'/><title type='text'>Getting Selection and Arrow keys to behave right with a ListBox in the.NET Compact Framework</title><content type='html'>I had a form in a Window Mobile application that contains a Label and a &lt;strong&gt;ListBox&lt;/strong&gt;.  I wanted the ListBox to behave according to the Windows Mobile UI guidelines where you click on an item with the stylus and it is automatically selected.   I used the &lt;strong&gt;SelectedIndexChanged&lt;/strong&gt; event to implement this behavior and it worked fine when an item was selected with the stylus.  However, with all of the different kinds of devices, many of them have partial or even full keyboards and at the very least they have a joypad or equivalent,  my users were wanting to use the arrow keys to navigate to a specific item in the list and then press the enter button (never using the stylus).  Unfortunately, the SelectedIndexChanged event is fired anytime the ListBox’s selected item is change (by stylus or keys) and since using the arrow keys usually requires scrolling through several items before getting to the item you want, the next item in the list is always selected (be it the one you want or not).  I could not find a way in the .NET Compact Framework to get the ListBox to work like I wanted.  &lt;br /&gt;&lt;br /&gt;My solution was to replace the &lt;strong&gt;ListBox&lt;/strong&gt; with a &lt;strong&gt;ListView&lt;/strong&gt;.  Change the &lt;strong&gt;View&lt;/strong&gt; property to Details and change the &lt;strong&gt;Activation&lt;/strong&gt; property to OneClick.  Then use the &lt;strong&gt;ItemActivate&lt;/strong&gt; event provided by the ListView instead of the SelectedIndexChanged event.    You also have to add at least one Column to the ListView, and you can optionally set &lt;strong&gt;HeaderStyle&lt;/strong&gt; to None to get rid of the column header and make the ListView look just like a ListBox.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-8885903424045867089?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/8885903424045867089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=8885903424045867089' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8885903424045867089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/8885903424045867089'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/06/getting-selection-and-arrow-keys-to.html' title='Getting Selection and Arrow keys to behave right with a ListBox in the.NET Compact Framework'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-2472326551475299500</id><published>2008-05-29T12:10:00.000-07:00</published><updated>2008-05-29T12:16:22.810-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Nothing'/><category scheme='http://www.blogger.com/atom/ns#' term='Is'/><category scheme='http://www.blogger.com/atom/ns#' term='IsNot'/><title type='text'>Not xxx Is Nothing and xxx IsNot Nothing in VB.NET</title><content type='html'>It took me a while to figure that that you can say:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;If var1 IsNot Nothing Then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;End If&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Instead of the awkward:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;If Not var1 is Nothing Then &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3333ff;"&gt;End If&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;span &gt;&lt;span style="color:#000000;"&gt;Of course the &lt;strong&gt;IsNot&lt;/strong&gt; is like the &lt;strong&gt;Is&lt;/strong&gt; and will work with when comparing any two object references, not just for testing for Nothing.&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-2472326551475299500?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/2472326551475299500/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=2472326551475299500' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2472326551475299500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2472326551475299500'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/05/not-xxx-is-nothing-and-xxx-isnot.html' title='Not xxx Is Nothing and xxx IsNot Nothing in VB.NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-5499035483295575956</id><published>2008-05-20T15:01:00.000-07:00</published><updated>2011-06-28T14:46:53.500-07:00</updated><title type='text'>Finding the "My Documents" folder in VB.net</title><content type='html'>Finding the My Documents folder in VB.NET (or C#) is pretty simple:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="Vb"&gt;Dim dir as String&lt;br /&gt;dir = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;There are several other special folders you can get as well:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Personal (My Documents also work on devices)&lt;/li&gt;&lt;li&gt;MyPictures&lt;/li&gt;&lt;li&gt;DesktopDirectory&lt;/li&gt;&lt;li&gt;MyMusic&lt;/li&gt;&lt;li&gt;StartMenu&lt;/li&gt;&lt;li&gt;Startup&lt;/li&gt;&lt;li&gt;Favorites&lt;/li&gt;&lt;li&gt;ApplicationData&lt;/li&gt;&lt;li&gt;CommandApplicationData&lt;/li&gt;&lt;li&gt;CommonProgramFiles&lt;/li&gt;&lt;li&gt;Cookies&lt;/li&gt;&lt;li&gt;History&lt;/li&gt;&lt;li&gt;InternetCache&lt;/li&gt;&lt;li&gt;LocalApplicationData&lt;/li&gt;&lt;li&gt;MyComputer&lt;/li&gt;&lt;li&gt;ProgramFiles&lt;/li&gt;&lt;li&gt;Programs&lt;/li&gt;&lt;li&gt;Recent&lt;/li&gt;&lt;/ul&gt;Here is another article on using SpecialFolders:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.thescarms.com/dotnet/SpecialFolders.aspx"&gt;http://www.thescarms.com/dotnet/SpecialFolders.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-5499035483295575956?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/5499035483295575956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=5499035483295575956' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5499035483295575956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5499035483295575956'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/05/finding-my-documents-folder-in-vbnet.html' title='Finding the &quot;My Documents&quot; folder in VB.net'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-2835067635012814017</id><published>2008-05-16T09:41:00.000-07:00</published><updated>2008-05-16T09:54:23.315-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MessageBox'/><category scheme='http://www.blogger.com/atom/ns#' term='StartPosition'/><title type='text'>StartupPosition for MessageBox</title><content type='html'>Sometimes it seems that .NET has some obvious shortcomings.  For example, all I want to do is have a MessageBox center in my application instead of the screen.   This task shouldn't be that difficult; however, there is no way (that I have found) to set the StartPosition property for the MessageBox dialog.   While there may be a &lt;a href="http://www.jonathancoulton.com/songdetails/Code%20Monkey"&gt;functional and elegant&lt;/a&gt; solution to this problem (please post as a comment if you have one), the only solution I have found on the internet is to implement your own MessageBox class, and code it to do what you want.   This isn't hard, but it doesn't seem like a lot of work for something so simple.   Also, the Messagebox probably does more than you might first think.  It does a lot of autosizing to hold whatever text you provide it.&lt;br /&gt;&lt;br /&gt;Here is one implementation of a custom MessageBox I have found:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/dialog/MessageBoxEx.aspx?fid=155440&amp;amp;df=90&amp;amp;mpp=25&amp;amp;noise=3&amp;amp;sort=Position&amp;amp;view=Quick&amp;amp;fr=76&amp;amp;select=1069708"&gt;http://www.codeproject.com/KB/dialog/MessageBoxEx.aspx?fid=155440&amp;amp;df=90&amp;amp;mpp=25&amp;amp;noise=3&amp;amp;sort=Position&amp;amp;view=Quick&amp;amp;fr=76&amp;amp;select=1069708&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I am sure there are more such implementations.  Please post comments if you know of any.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-2835067635012814017?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/2835067635012814017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=2835067635012814017' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2835067635012814017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2835067635012814017'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/05/startupposition-for-messagebox.html' title='StartupPosition for MessageBox'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-2377082675940191964</id><published>2008-05-14T13:38:00.000-07:00</published><updated>2008-05-14T13:39:55.761-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PInvoke Interop Signatures VB.NET C#'/><title type='text'>Finding VB.NET or C# Signatures for Interop/PInvoke</title><content type='html'>There are several places to find the Signatures in VB.NET and C# for Win32Api calls online.  Here is one that is pretty good:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://pinvoke.net/"&gt;http://pinvoke.net&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-2377082675940191964?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/2377082675940191964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=2377082675940191964' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2377082675940191964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/2377082675940191964'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/05/finding-vbnet-or-c-signatures-for.html' title='Finding VB.NET or C# Signatures for Interop/PInvoke'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-340287826528444883</id><published>2008-05-14T09:33:00.000-07:00</published><updated>2008-05-14T10:19:12.708-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenFileDialog Thumbnail View Type'/><title type='text'>Defaulting to Thumbnail View when using OpenFileDialog</title><content type='html'>You would think that it would be very simple to default an &lt;strong&gt;OpenFileDialog&lt;/strong&gt; to any view type you want via its properties. However, there is no property exposed for setting the view type. I simply want to browse for images with my OpenFileDialog instance, and I would prefer for the user not to have to manually set the view type to Thumbnail everytime.&lt;br /&gt;&lt;br /&gt;I found a couple of solutions:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/cs/miscctrl/FileDialogExtender.asp"&gt;http://www.codeproject.com/cs/miscctrl/FileDialogExtender.asp&lt;/a&gt;   (C#)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2741273&amp;amp;SiteID=1&amp;amp;mode=1"&gt;http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2741273&amp;amp;SiteID=1&amp;amp;mode=1&lt;/a&gt;  (same as above only in VB.NET)&lt;br /&gt;&lt;br /&gt;and the following offers even more functionality:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/dialog/OpenFileDialogEx.aspx"&gt;http://www.codeproject.com/KB/dialog/OpenFileDialogEx.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If someone else has found or created a better solution, please let me know.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-340287826528444883?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/340287826528444883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=340287826528444883' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/340287826528444883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/340287826528444883'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/05/defaulting-to-thumbnail-view-when-using.html' title='Defaulting to Thumbnail View when using OpenFileDialog'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4768571651580285164.post-5070647278722807410</id><published>2008-05-12T15:55:00.000-07:00</published><updated>2008-05-12T15:57:44.813-07:00</updated><title type='text'>Converting VB.NET to C# and C# to VB.NET</title><content type='html'>Here is a web site that will quickly converting VB.NET to C# or C# to VB.NET:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://labs.developerfusion.co.uk/convert/csharp-to-vb.aspx"&gt;http://labs.developerfusion.co.uk/convert/csharp-to-vb.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It is not perfect, but it does all of the grunt work and it is free.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4768571651580285164-5070647278722807410?l=dotnetref.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetref.blogspot.com/feeds/5070647278722807410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4768571651580285164&amp;postID=5070647278722807410' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5070647278722807410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4768571651580285164/posts/default/5070647278722807410'/><link rel='alternate' type='text/html' href='http://dotnetref.blogspot.com/2008/05/converting-vbnet-to-c-and-c-to-vbnet.html' title='Converting VB.NET to C# and C# to VB.NET'/><author><name>srego</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
