Thursday 30 October 2014

C# WinForms - How to Select All Text in a Multiline Textbox


You can either override KeyUp or KeyDown for your TextBox. Simply use the following code...


Code Snippet
  1. private void TextBox_KeyUp(object sender, KeyEventArgs e)
  2. {
  3.     if (e.KeyData == (Keys.Control | Keys.A))
  4.         TextBox.SelectAll();
  5. }
End of Code Snippet

Wednesday 29 October 2014

Email Marketing Lists - Email Lists - Targeted Business Email Campaigns


Web Contact Scraper is a fully automated software application for gathering targeted business contact information!
Web Contact Scraper allows you to retrieve thousands of business contact information entries in real-time. You can use this information to start your very own business campaign. Are you a new business owner? Want to advertise to other similar businesses to promote yourself or a service? Then Web Contact Scraper is for you!
Web Contact Scraper allows you to set multiple business key words and locations within a single search. For example, you can search for: Construction, Plumbing, Electricians, Building, Landscaping in all 50 states! While this search may take a little time to complete, you can leave the application running while you see results appear in real-time! No more waiting for long queries to complete!
Web Contact Scraper allows you to remove duplicate contact information on-the-fly.
You may chose to export you results to CSV any time!
Web Contact Scraper includes proxy support to build your business databases anonymously!
  • Search for multiple business key words (I.e. Construction, Dentist, Lawyer)
  • Search within multiple cities, states and countries!
  • See the search results appear in real-time!
  • In-built tool to remove duplicate contact information
  • Export results to CSV
  • Proxy IP Support to scrape anonymously!
  • Lifetime Licence Key for up to 2 Computers
  • 1 Full Year of Free Product Updates
  • Excellent Customer Support Service
  • All This for Only $19.95!

- See more at: http://ginkosolutions.com/webcontactscraper


How to get Business Data & Contact Information (Web Contact Scraper)


Web Contact Scraper is a fully automated software application for gathering targeted business contact information!
Web Contact Scraper allows you to retrieve thousands of business contact information entries in real-time. You can use this information to start your very own business campaign. Are you a new business owner? Want to advertise to other similar businesses to promote yourself or a service? Then Web Contact Scraper is for you!
Web Contact Scraper allows you to set multiple business key words and locations within a single search. For example, you can search for: Construction, Plumbing, Electricians, Building, Landscaping in all 50 states! While this search may take a little time to complete, you can leave the application running while you see results appear in real-time! No more waiting for long queries to complete!
Web Contact Scraper allows you to remove duplicate contact information on-the-fly.
You may chose to export you results to CSV any time!
Web Contact Scraper includes proxy support to build your business databases anonymously!
  • Search for multiple business key words (I.e. Construction, Dentist, Lawyer)
  • Search within multiple cities, states and countries!
  • See the search results appear in real-time!
  • In-built tool to remove duplicate contact information
  • Export results to CSV
  • Proxy IP Support to scrape anonymously!
  • Lifetime Licence Key for up to 2 Computers
  • 1 Full Year of Free Product Updates
  • Excellent Customer Support Service
  • All This for Only $19.95!

- See more at: http://ginkosolutions.com/webcontactscraper


Wednesday 22 October 2014

C# - How to Return a Substring Between Two Strings


Here is a non-RegEx solution for returning a substring between two strings in C#. I have also added a function for retrieving multiple occurrences which outputs as a List of strings.

The parameters called: includeFrom and includeUntil allow you to append the from and until fields to the result.


Usage:

Code Snippet
  1. // Example for one occurrences
  2. // This extracts 'Message Here' from this example chat log
  3. string message = "[12th July 2014] Message Here (Sent by Sean)".Substring(from: "]", until: "(", includeFrom: false, includeUntil: false);
  4. // Example for multiple occurances
  5. // This extracts all of the names which are enclosed between single quotes
  6. List<string> listOfNames = "'sean' random text 'dave' 355353 'jane' some text here 'tom'".SubstringAll(from: "'", until: "'");
End of Code Snippet



The Code:
Code Snippet
  1. /// <summary>
  2. /// Returns a substring between two anchor strings
  3. /// If from is null - Start of the string until the Second anchor
  4. /// If until is null - First anchor to the end of the string is returned
  5. /// </summary>
  6. /// <param name="this">Input string</param>
  7. /// <param name="from">An optional string to search after</param>
  8. /// <param name="until">An optional string to search before</param>
  9. /// <param name="includeFrom">Include from in the result</param>
  10. /// <param name="includeUntil">Include until in the result</param>
  11. /// <param name="comparison">An optional comparison for the search</param>
  12. /// <returns>A substring based on the search</returns>
  13. public static string Substring(this string @this, string from = null, string until = null, bool includeFrom = false, bool includeUntil = false, StringComparison comparison = StringComparison.InvariantCulture)
  14. {
  15.     var fromLength = (from ?? string.Empty).Length;
  16.     var startIndex = !string.IsNullOrEmpty(from)
  17.         ? @this.IndexOf(from, comparison) + fromLength
  18.         : 0;
  19.  
  20.     if (startIndex < fromLength) { return string.Empty; }
  21.  
  22.     var endIndex = !string.IsNullOrEmpty(until)
  23.     ? @this.IndexOf(until, startIndex, comparison)
  24.     : @this.Length;
  25.  
  26.     if (endIndex < 0) { return string.Empty; }
  27.  
  28.     if (includeFrom) // Do these AFTER start and end have been calculated
  29.         startIndex -= from.Length;
  30.     if (includeUntil)
  31.         endIndex += until.Length;
  32.  
  33.     return @this.Substring(startIndex, endIndex - startIndex);
  34. }
  35.  
  36. /// <summary>
  37. /// Returns a List of substrings between two anchor strings
  38. /// If from is null - Start of the string until the Second anchor
  39. /// If until is null - First anchor to the end of the string is returned
  40. /// </summary>
  41. /// <param name="this">Input string</param>
  42. /// <param name="from">An optional string to search after</param>
  43. /// <param name="until">An optional string to search before</param>
  44. /// <param name="includeFrom">Include from in the result</param>
  45. /// <param name="includeUntil">Include until in the result</param>
  46. /// <param name="skipEmptyResults">If empty results are found, then they are not added to the result set.</param>
  47. /// <param name="comparison">An optional comparison for the search</param>
  48. /// <returns>A List of substrings based on the search</returns>
  49. public static List<string> SubstringAll(this string @this, string from = null, string until = null, bool includeFrom = false, bool includeUntil = false, bool skipEmptyResults = true, StringComparison comparison = StringComparison.InvariantCulture)
  50. {
  51.     List<string> result = new List<string>();
  52.     try
  53.     {
  54.         while (true)
  55.         {
  56.             string res = @this.SubstringEx(from, until, includeFrom, includeUntil, comparison);
  57.  
  58.             if (!skipEmptyResults || !string.IsNullOrEmpty(res)) // Skip empty result sets
  59.                 result.Add(res);
  60.  
  61.             res = (!includeFrom) ? from + res : res;
  62.  
  63.             // If from and until are the same, then we can end up with problems and only returning half the result set. This fixes that problem.
  64.             if (from != until)
  65.                 res = (!includeUntil) ? res + until : res;
  66.  
  67.             @this = @this.Replace(res, string.Empty);
  68.         }
  69.     }
  70.     catch { }
  71.  
  72.     return result;
  73. }
End of Code Snippet

Monday 20 October 2014

Etsy Toolbox - Add Followers, Message Users, Favourite Shops and More!


I came across this application called Etsy Toolbox, written by a former college room mate and I thought I would help him out by posting his software here. It's a great Etsy Shop tool and aides SEO.

- See more at: http://ginkosolutions.com/etsytoolbox

Etsy Toolbox is a low cost solution for marketing your Etsy Store. The application allows you to automatically add/remove followers, add/remove favourites and send messages to users on a large scale!


  • Add/Remove Etsy Followers... Getting your Etsy Store Noticed!
  • Add/Remove Etsy Favourites... Boosting your Stores Search Ranking
  • Mass Message Etsy Users, Followers and Favouriters!
  • Manage Message Templates with an In-built Template Management Tool
  • Manage Multiple Etsy Stores within one Single Application!
  • Build a Custom Unique Audience by Controlling Which Users to Follow/Favourite and Message Based on Custom Search Criteria
  • Proxy IP Support
  • Lifetime Licence Key for up to 2 Computers
  • 1 Full Year of Free Product Updates
  • Excellent Customer Support Service
  • All This for Only $29.95!

- See more at: http://ginkosolutions.com/etsytoolbox

Get Etsy Followers - Get Etsy Shop Noticed - Get Etsy Sales - Etsy Toolbox


I came across this application called Etsy Toolbox, written by a former college room mate and I thought I would help him out by posting his software here. It's a great Etsy Shop tool and aides SEO.

- See more at: http://ginkosolutions.com/etsytoolbox

Etsy Toolbox is a low cost solution for marketing your Etsy Store. The application allows you to automatically add/remove followers, add/remove favourites and send messages to users on a large scale!


  • Add/Remove Etsy Followers... Getting your Etsy Store Noticed!
  • Add/Remove Etsy Favourites... Boosting your Stores Search Ranking
  • Mass Message Etsy Users, Followers and Favouriters!
  • Manage Message Templates with an In-built Template Management Tool
  • Manage Multiple Etsy Stores within one Single Application!
  • Build a Custom Unique Audience by Controlling Which Users to Follow/Favourite and Message Based on Custom Search Criteria
  • Proxy IP Support
  • Lifetime Licence Key for up to 2 Computers
  • 1 Full Year of Free Product Updates
  • Excellent Customer Support Service
  • All This for Only $29.95!

- See more at: http://ginkosolutions.com/etsytoolbox

Free VPN Servers - USA, Canada and European Servers


It's a well known fact that using the internet exposes personal information regarding things such as: Your browsing habits, sensitive information and more. We can try and avoid circumstances such as these by using private sessions (private/incognito mode) in browsers like Firefox and Google Chrome. However, this isn't typically enough. So, how can we protect ourselves and our personal information?

Proxies
Use of proxies and anonymous proxies have been around since the birth of the internet. It is a means where we can establish a connection to our target (I.e. Google.com) using another computer or server. We are exposed to the target as the proxy server, thus protecting our true identity (Sometimes your IP is passed in a request header, so it's good to check this first)!
However, proxy lists are very well used by spammers, scammers, auto-emailers, auto-forum posters these days and you'll find that some websites have blacklisted these IP addresses. More importantly, the proxy server may purely exist as a honeypot. Proxy servers should generally never be trusted with sensitive information (Passwords, bank details etc.) unless it's administrator is known to you.

Virtual Private Network (VPN)
Moving on to VPN services... A VPN is a private network, typically operated by a company or business. Like a proxy server, your target (I.e. Google.com) identifies you as a user of the VPN and your IP address you expose to your target will reflect this. A VPN is a fancy way of saying "A group of computers which can hook up to a large public group of computers, such as the internet".

Websites such as HideMyAss.com offer a VPN service for a monthly charge (Around $10). See a cost and service comparison chart here.

Free VPN services exist, but similar to proxy servers, these free VPN services can exist as a honeypot. A good way of inspecting free VPN solutions (and proxy servers for that matter) is to find trusting users who have reviewed them. As a trusting user, I can offer a recommendation for a free VPN service called VPNBook.

Download Links
Download VPNBook Servers
Download OpenVPN Client (For connecting to VPNBook Servers)
Independent VPNBook Review

Friday 3 October 2014

A duplicate value cannot be inserted into a unique index - SQL Error


You will typically receive this error when you are attempting to insert a row into a table. A column within your table will be a unique indexed column (Probably a Primary Key), and your new row has a value for this column which already exists within the database, making it a duplicate.

If the problem is your primary key, it's probably set to auto-increment and you have recently dropped some tables or refreshed your database for example. The problem therefore lies with your databases Seed Value. With the auto-increment properly of the primary key, the Seed Value will determine the next ID for your primary key. Chances are this has probably been reset with your recently database refresh. You can solve this issue with the following line of code...

ALTER TABLE tablename ALTER COLUMN columnname IDENTITY (newseedvalue, 1)

If your primary key values end at 150 for example, then you should replace 'newseedvalue' with 151. This will then be the new seed value for the next primary key.

Example (Start PK Identity at 1 for the tblNames table):
ALTER TABLE tblNames ALTER COLUMN ID IDENTITY (1, 1)