Category: C Sharp , C#

How To Check for Program updates in C#

Part 1 : Hi, have a good day. This simple class will help to check for your application updates, and it’s very simple. First create a text file on your website “myapp-pro.txt” for example: and add the following content to it : MyAppPro;2.0;http://www.smart-arab.com/MyAppPro-2.0.zip Notice that each properties is  separated with “;”. C# Class : class CheckUpdates { […]

Access INI File with C#

Hi have a good day This simple class will allow to Write and Read INI Files ( Old Windows Settings Files ) using System; using System.Runtime.InteropServices; using System.Text; class INIFile { [DllImport(“kernel32.dll”)] private static extern int WritePrivateProfileString(string ApplicationName, string KeyName, string StrValue, string FileName); [DllImport(“kernel32.dll”)] private static extern int GetPrivateProfileString(string ApplicationName, string KeyName, string DefaultValue, […]

Detect if string Non English language C#

  This class will help you to detect if the string contains non English characters , The System.Text.RegularExpressions namespace contains classes that provide access to the .NET Framework regular expression engine. ( Regex )   public bool IsEnglish(string inputstring) { Regex regex = new Regex(@”[A-Za-z0-9 .,-=+(){}\[\]\\]”); MatchCollection matches = regex.Matches(inputstring); if (matches.Count.Equals(inputstring.Length)) return true; else […]