Owner: Software Development Topics URL:http://www.devtopics.com Join Date: Wed, 13 Jun 2007 10:56:58 -0500 Rating:0 Site Description: DevTopics.com is a blog about software development topics, with a focus on C# and the Microsoft .NET framework. DevTopics also discusses the creation and management of software companies, the software development process, and improving the computer experi Site statistics:Click here
.NET Assembly FAQ - Part 2 - Attributes 2007-06-12 10:16:53 This multi-part article answers common questions about assemblies, the basic building blocks of .NET applications. This Part 2 discusses assembly attributes.
(more…) Read more:Assembly
, Attributes
C# Search/Replace in Files 2007-06-07 08:19:30 Sometimes you need a quick & easy way to search and replace text in a file. The following code shows how it can be done using the static methods on the Regex regular expression class. Because this sample loads the entire file contents in memory, is not appropriate for very large files.
(more…) Read more:Search
Console Output from a WinForms Application 2007-06-04 16:37:02 You may wish to enable your WinForms application to run from a console window or command line. And when it does, you probably want to send output messages to the console window that launched your WinForms application.
Unfortunately Console
.WriteLine()–the standard method of writing to the console window–by default will not work from a WinForms application. That's because the console window that launched your WinForms application belongs to the cmd.exe process, which is separate from your WinForms application process.
(more…) Read more:Application
, Output
.NET Assembly FAQ - Part 1 2007-05-31 09:14:33 Frequently asked questions, some assembly required.
This multi-part article answers common questions about assemblies–the basic building blocks of .NET applications. Some developers may never need to understand assemblies. But if you create shared components, use DLLs or deliver a suite of applications, then it's essential to understand what .NET assemblies are and how they work.
(more…) Read more:Assembly
Adding Assemblies to the Visual Studio "Add Reference" Dialog 2007-05-30 18:28:09 When you attempt to add an assembly reference to a Visual
Studio project, the Add Reference dialog appears with a list of registered global assemblies in the .NET tab:
Add Your Assembly to Visual Studio
Unfortunately, adding your assembly to the Global Assembly Cache (GAC) does NOT make it automatically appear in the Visual Studio list of installed assemblies; you must add your assembly manually as follows:
(more…) Read more:Dialog
.NET Assembly FAQ - Part 3 - Strong Names and Signing 2007-06-15 10:16:32 This multi-part article answers common questions about assemblies, the basic building blocks of .NET applications. This Part 3 discusses assembly security using strong names, signing and public-private key pairs.
(more…) Read more:Assembly
, Names
, Strong
Move "My Documents" Folder 2007-06-13 12:18:08 Many applications store data in the "My Documents
" folder. Unfortunately, by default this folder is buried at "C:Documents and SettingsUserNameMy Documents".
A smarter approach is to separate your programs and data. For example, I store the operating system and programs on my C: drive and all data on my D: drive.
But simply moving your data is not enough–you need to tell applications and the operating system where to find it.
(more…) Read more:Folder
Embed Google Ad in First WordPress Post 2007-06-19 09:04:43 The leading SEO (Search Engine Optimization) sites will tell you that placing an ad after the first post in your blog's home page is particularly effective. This is because the ad is essentially embedded in the blog content, hence your readers are less likely to develop "ad blindness" and skip over the ad as usual.
To place an ad after the first post in your WordPress blog main page:
(more…) Read more:First
, Google
Lighten and Darken Colors in .NET 2007-06-22 11:50:27 There is a very handy .NET class called ControlPaint in the System.Windows.Forms namespace that enables you to draw your own controls and control elements using the standard Windows style and theme. Buried in this rich class are four methods that enable you to lighten and darken colors:
(more…) Read more:Colors
C# GetPixel and SetPixel 2007-06-20 12:32:49 It's hard to believe the comprehensive .NET framework would omit such obvious functions as GetPixel and SetPixel from its Drawing library. Fortunately, we can access the GDI functions using Interop, as shown below. Notice the conversion required between the COLORREF integer used by the GDI methods and the Color structure used by our static .NET methods.
(more…)
List Drives and Volumes from .NET 2007-06-25 11:28:04 The .NET Framework v2.0 did a nice job filling many holes in the System.IO namespace, especially when it comes to managing the file system. One such addition is the DriveInfo class, which enables you to determine what drives are available, their type, capacity and available free space.
(more…) Read more:Volumes
Determine if a Loaded .NET Assembly is Signed 2007-06-25 09:51:02 A .NET assembly is "signed" if the developer compiled the assembly with the private key of a digital signature. When the system later loads the assembly, it verifies the assembly with the corresponding public key. Occasionally you may need to determine whether an assembly you have loaded has been signed.
(more…) Read more:Assembly
, Loaded
, Signed
Hide Form from Alt+Tab 2007-06-29 07:35:12 When you show a .NET Form, by default the form will appear in the Windows Start bar and in the list of open windows shown when the user presses Alt+Tab.
(more…)
.NET Assembly FAQ - Part 4 - Global Assembly Cache 2007-06-28 11:36:08 This multi-part article answers common questions about assemblies, the basic building blocks of .NET applications. This Part 4 covers shared assemblies and the GlobalAssembly
Cache.
(more…)
Change Font Style 2007-07-05 08:02:53 Changing a font style is a bit easier than changing its size, as there is a Font constructor that accepts a font and style as arguments. For example, to bold a label's font:
(more…) Read more:Change
, Style
Change Font Size 2007-07-05 07:58:39 An inspection of the Font class will reveal that every public property is read-only. This means to change a font's size, you need to create a new Font object with all the same properties of your current font but with the new size. Here is a handy method to do just that:
(more…) Read more:Change
Determine the .NET Versions on which an Application is Compiled and Running 2007-07-11 20:52:58 The version of .NET against which you compile an application or assembly may not be the same version of .NET on which the application is currently running. A .NET application should always be able to run on the same or newer version of .NET against which it was compiled.
This is because .NET is backward compatible. This means that an application compiled on .NET v1.1 should run OK on .NET v2.0 and v3.0. But an application compiled on .NET v2.0 will not run on .NET v1.1.
(more…) Read more:Application
ASCII Table 2007-07-16 10:02:06 Did you know? You can type ASCII
characters into any application. Press and hold the Left-Alt key, then using the numeric keypad, type the four-digit decimal number for the ASCII character you want, then release the Left-Alt key. For example, to type è, press and hold Left-Alt, then type 0232 on the numeric keypad. When you release the Left-Alt key, è will be typed.
Here is the world famous ASCII table:
(more…) Read more:Table
In C#, a string is a String 2007-07-19 08:45:28 C# includes a number of pre-defined "built-in" data types. Each built-in data type is represented by a class in the System namespace that inherits from the base System.Object class. For example, an integer is represented by the System.Int32 class, and a string is represented by the System.String class.
C# defines an alias keyword for each built-in type. The alias keyword and its corresponding C# type are interchangeable. For example, you can define a string with the "string" keyword or "System.String" type:
(more…)
C# String Tips 2007-07-18 12:15:04 The .NET string class is quite comprehensive, yet some common string functions are missing or not entirely obvious. This article provides quick tips on using .NET strings.
(more…) Read more:String