====== C# (c sharp) ====== C# is the programming language of choice for developing .Net applications on Windows. ===== Visual Studio Express ===== * the "Terminal Services" service needs set to "manual" * 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't have: * [[http://en.wikipedia.org/wiki/Microsoft_Foundation_Classes|MFC]] - Microsoft Foundation Classes (see wikipedia) * [[http://en.wikipedia.org/wiki/Active_Template_Library|ATL]] - Active Template Library (workaround exists) * [[http://en.wikipedia.org/wiki/Windows_Template_Library|WTL]] - Windows Template Library (workaround exists, now open source) * info from http://www.codeproject.com/useritems/FreeVS2005Win32.asp * [[http://www.wxwidgets.org/|wxWidgets]] can be used ===== Errors when running an executable from a network location ===== * Source: http://msdn.microsoft.com/msdnmag/issues/04/06/NET/ .Net is by default configured with CAS (code access security). This causes the executable to throw an exception if security permissions are not configured properly. If the application does not handle this exception, then the user will see an error that lacks information, and gives the appearance that your application is broken (your fault). 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("This application requires full-trust " + "security permissions to execute." + "(maybe you are trying to run this from a network?)"); } } } } ===== Encryption ===== * http://www.codeproject.com/dotnet/SimpleEncryption.asp