Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
docs:programming:c_sharp [2007/01/24 13:36] – billh | docs:programming:c_sharp [2008/08/03 00:25] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== C# (c sharp) ====== | ||
+ | C# is the programming language of choice for developing .Net applications on Windows. | ||
+ | ===== Visual Studio Express ===== | ||
+ | * the " | ||
+ | * FIXME (move to another page) the Express edition of Visual Studio C++ always builds against the .Net framework (NOT 32-bit native) | ||
+ | * it has been said that 32-bit native apps are possible, but VS C++ Express doesn' | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * info from http:// | ||
+ | * [[http:// | ||
+ | |||
+ | ===== Errors when running an executable from a network location ===== | ||
+ | * Source: | ||
+ | .Net is by default configured with CAS (code access security). | ||
+ | |||
+ | To remedy the situation, you need to do something about CAS. The recommended solution is to handle the error.< | ||
+ | edit program.cs... | ||
+ | |||
+ | // standard namespaces (for this app) | ||
+ | using System; | ||
+ | using System.Collections.Generic; | ||
+ | using System.Windows.Forms; | ||
+ | |||
+ | // add the following namespaces | ||
+ | using System.Security; | ||
+ | using System.Security.Permissions; | ||
+ | |||
+ | // modify the class to handle the error, similar to the following: | ||
+ | namespace ChecksumUtility | ||
+ | { | ||
+ | static class Program | ||
+ | { | ||
+ | /// < | ||
+ | /// The main entry point for the application. | ||
+ | /// </ | ||
+ | [STAThread] | ||
+ | static void Main() | ||
+ | { | ||
+ | |||
+ | try | ||
+ | { | ||
+ | // Demand full trust permissions | ||
+ | PermissionSet fullTrust = new | ||
+ | PermissionSet(PermissionState.Unrestricted); | ||
+ | fullTrust.Demand(); | ||
+ | |||
+ | // Perform normal application logic | ||
+ | Application.EnableVisualStyles(); | ||
+ | Application.SetCompatibleTextRenderingDefault(false); | ||
+ | Application.Run(new Form1()); | ||
+ | |||
+ | // Report that permissions were not full trust | ||
+ | } | ||
+ | catch (SecurityException) | ||
+ | { | ||
+ | MessageBox.Show(" | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Encryption ===== | ||
+ | * http:// |