This Free XLSX Library Will help you to Import or Export DataTable or DataGridView to Excel XLSX File Using C# .NET , with no need to install Office. Just Add the SmartArabXLSX Library to your C# Project Reference and Start using it. How to use it: private void Examble () { //Init dataTable DataTable mydatatable […]
Category: C Sharp , C#
Hi, have a good day this class will help you to Improve string extensions in C#, It will be update frequently by many C# programmers. It will ease the using of strings in C# project while coding. For Example : This code will allow you to get the count of capital letters, or Reverse your […]
Hi, have a good day this simple library will help you to encrypt and decrypt files. (Binary files) And it’s very easy to use: Usage Example : // you secret key don;t change the length, change the bytes! byte[] key = { 0x01, 0x02, 0x03, 0x05, 0x07, 0x0B, 0x0D, 0x11, 0x12, 0x11, 0x0D, 0x0B, 0x07, […]
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 { […]
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, […]
Hi , Have a good day. This Piece of code will allow you, to Get information from Web page or Send Information to it, By Using POST method trough C# to a PHP Page. C#—-> Send Data —-> PHP Page —-> Processing Data —-> C# Get Information. Let me Show you the code Usage Example […]
This Simple Class will allow you to Save and restore any class instance using files. It’s very useful if you want to save your Application settings, Specially if your Application is portable, Or if you do want to use Windows registry. The Class Code : using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Reflection; […]
By using this simple class you will be able to Export or Import DataTable to or from a Plain Text file or CSV , with delimited option . using System; using System.Data; using System.IO; class DataTable_ExportImport { /// <summary> /// Export DataTable Columns , Rows to file /// </summary> /// <param name="datatable">The […]
You can call this function to Current Directory for your running Application public static string GetAppPath() { string ExePath = System.Windows.Forms.Application.ExecutablePath; if (Path.GetDirectoryName(ExePath).EndsWith("\\")) { return Path.GetDirectoryName(ExePath); } else { return Path.GetDirectoryName(ExePath) + "\\"; } }
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 […]