Code Snippets
Snippet is a programming term for a small region of re-usable source code, machine code or text. Ordinarily, these are formally-defined operative units to incorporate into larger programming modules. Snippets are often used to clarify the meaning of an otherwise "cluttered" function, or to minimize the use of repeated code that is common to other functions.
The purpose of this archive is to share code snippets, scripts, and functions with the Open Source Software Community.
Whats new in C# Code Snippets
C#
- Populate ComboBox using DataTable. (C-Sharp) C# code snippet CreateDropDownMenu to populate ComboBox dropdown menu with given DataTable.
- C# Code Snippet - AddSlashes StripSlashes Escape String. (C-Sharp) C# code snippet AddSlahes tool allows quote a string with slashes (Escape String). Stripslashes snippet un-quotes a quote string by removing slashes.
- C# Code Snippet - Access current environment directories and logical drives. (C-Sharp) C# code snippets to access current environment directories such as current directory, system directory and logical drives.
- C# Code Snippet - Convert Unix timestamp. (C-Sharp) C# code snippets convert date/time between DateTime and Unix timestamp. Most .Net base applications never use Unix timestamp, but if you want to create a application to interact with other application or sites, maybe built in PHP or Java, use these methods to convert Unix timestamp.
- C# Code Snippet - Upload file to FTP Server. (C-Sharp) C# code snippet upload file to FTP Server. This method login to FTP server using username and password and upload the local file to given FTP location.
C#
- C# Code Snippet - Validate (int) Integer. (C-Sharp) C# code snippets return the validated int value by checking validity of the given int and checking the int value range within the given minimum and maximum int range.
- C# Code Snippet - Find starting and ending date for given date. (C-Sharp) C# code snippets return the Ending Date and Starting Date for given date. Simply pass DateTime value that need to find date and snippets will return starting and ending date as DateTime.
- C# Code Snippet - Get local computer host name. (C-Sharp) C# code snippet get the host name from the local machine.
- C# Code Snippet - Get local computer IP address. (C-Sharp) C# code snippet get the IP address from the local machine. For computers with multiple IP addresses with one or more NIC cards can use IP address object list to obtain all the IP addresses.
- C# Code Snippet - Compile C# or VB source code run-time. (C-Sharp) C# code snippet compile C# or VB source code run-time from a text string or external text file and build the executable. Programmatically compile code using C#/VB compiler.
Whats new in C++/CLI Code Snippets
C++/CLI
- Populate ComboBox using DataTable. C++/CLI code snippet CreateDropDownMenu to populate ComboBox dropdown menu with given DataTable.
- C++/CLI Code Snippet - AddSlashes StripSlashes Escape String. C++/CLI code snippet AddSlahes tool allows quote a string with slashes (Escape String). Stripslashes snippet un-quotes a quote string by removing slashes.
- C++/CLI Code Snippet - Access current environment directories and logical drives. C++/CLI code snippets to access current environment directories such as current directory, system directory and logical drives.
- C++/CLI Code Snippet - Convert Unix timestamp. C++/CLI code snippets convert date/time between DateTime and Unix timestamp. Most .Net base applications never use Unix timestamp, but if you want to create a application to interact with other application or sites, maybe built in PHP or Java, use these methods to convert Unix timestamp.
- C++/CLI Code Snippet - Upload file to FTP Server. C++/CLI code snippet upload file to FTP Server. This method login to FTP server using username and password and upload the local file to given FTP location.
C++/CLI
- C++/CLI Code Snippet - Validate (int) Integer. C++/CLI code snippets return the validated int value by checking validity of the given int and checking the int value range within the given minimum and maximum int range.
- C++/CLI Code Snippet - Find starting and ending date for given date. C++/CLI code snippets return the Ending Date and Starting Date for given date. Simply pass DateTime value that need to find date and snippets will return starting and ending date as DateTime.
- C++/CLI Code Snippet - Get local computer host name. C++/CLI code snippet get the host name from the local machine.
- C++/CLI Code Snippet - Get local computer IP address. C++/CLI code snippet get the IP address from the local machine. For computers with multiple IP addresses with one or more NIC cards can use IP address object list to obtain all the IP addresses.
- C++/CLI Code Snippet - Compile C# or VB source code run-time. C++/CLI code snippet compile C# or VB source code run-time from a text string or external text file and build the executable. Programmatically compile code using C#/VB compiler.
Whats new in PHP Code Snippets
PHP
- Validate IPv4, IPv6 IP Addresses. These PHP Code snippets show how to validate IPv4 or IPv6 IP addresses. Also it allows checking IP address belongs to private network address spaces.
- PHP Code Snippet - Check Email Headers. PHP code snippet to check email headers in a string. NoEmailHeaders function checks given string. Function return TRUE if there are no email headers in given string, if not function will return FALSE.
- PHP Code Snippet - Check for new line characters. PHP code snippet to check new lines in a string. NoNewLines function checks given string. Function return TRUE if there are no new line characters in given string, if not function will return FALSE.
PHP
- PHP Code Snippet - Validate Email Address. PHP code snippet to validate given email address. IsValidEmail function validate email address. Function return TRUE if valid email address found, if not function will return FALSE.
- PHP Code Snippet - Write data to text file. PHP code snippet to write text data into a file using file_put_contents function. Write2TxtFile function writes text data to a given file. Function return TRUE if data successfully written to file, if not function will return FALSE.
Whats new in VB Code Snippets
VB
- Populate ComboBox using DataTable. (VB) Visual Basic code snippet CreateDropDownMenu to populate ComboBox dropdown menu with given DataTable.
- Visual Basic Code Snippet - AddSlashes StripSlashes Escape String. (VB) Visual Basic code snippet AddSlahes tool allows quote a string with slashes (Escape String). Stripslashes snippet un-quotes a quote string by removing slashes.
- Visual Basic Code Snippet - Access current environment directories and logical drives. (VB) Visual Basic code snippets to access current environment directories such as current directory, system directory and logical drives.
- Visual Basic Code Snippet - Convert Unix timestamp. (VB) Visual Basic code snippets convert date/time between DateTime and Unix timestamp. Most .Net base applications never use Unix timestamp, but if you want to create a application to interact with other application or sites, maybe built in PHP or Java, use these methods to convert Unix timestamp.
- Visual Basic Code Snippet - Upload file to FTP Server. (VB) Visual Basic code snippet upload file to FTP Server. This method login to FTP server using username and password and upload the local file to given FTP location.
VB
- Visual Basic Code Snippet - Validate (int) Integer. (VB) Visual Basic code snippets return the validated int value by checking validity of the given int and checking the int value range within the given minimum and maximum int range.
- Visual Basic Code Snippet - Find starting and ending date for given date. (VB) Visual Basic code snippets return the Ending Date and Starting Date for given date. Simply pass DateTime value that need to find date and snippets will return starting and ending date as DateTime.
- Visual Basic Code Snippet - Get local computer host name. (VB) Visual Basic code snippet get the host name from the local machine.
- Visual Basic Code Snippet - Get local computer IP address. (VB) Visual Basic code snippet get the IP address from the local machine. For computers with multiple IP addresses with one or more NIC cards can use IP address object list to obtain all the IP addresses.
- Visual Basic Code Snippet - Compile C# or VB source code run-time. (VB) Visual Basic code snippet compile C# or VB source code run-time from a text string or external text file and build the executable. Programmatically compile code using C#/VB compiler.