Using Obsolete Attribute in C# .NET

C# has a built-in attribute that you can apply to any type in your C# code to designate a method as obsolete. To do that, before your method declaration, simply put in the [Obsolete] Attribute. For example: [Obsolete] private void testfunction() { //some code here } After you set this attribute in your code, every […]

C#: Save File Dialog

It’s fairly easy to call up the standard windows File Save dialog box. The following simple example shows you how to create an instance of SaveFileDialog, then assign different properties. Some of the properties: Title : name of the Save Dialog Box (such as “Save this text file to your document”) InitialDirectory: when the dialog […]

C#: Call External DLL Library

To import external DLL library file and be able to use the function in the library. (That is the way to make use of old windows dll libraries. To use a .NET assembly you would simply add the reference to .NET assembly and add the using clause.) You need to: Add the using System.Runtime.InteropServices (this […]