C# code to linkify urls in a string

It’s a pretty simple task you can acheive it with Regex and a ready-to-go regular expression from: http://regexlib.com/ Something like: var html = Regex.Replace(html, @”^(http|https|ftp)\://[a-zA-Z0-9\-\.]+” + “\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?” + “([a-zA-Z0-9\-\._\?\,\’/\\\+&amp;%\$#\=~])*$”, “<a href=\”$1\”>$1</a>”); You may also be interested not only in creating links but in shortening URLs. Here is a good article on this subject: Resolve and … Read more

Replace URLs in text with HTML links

Let’s look at the requirements. You have some user-supplied plain text, which you want to display with hyperlinked URLs. The “http://” protocol prefix should be optional. Both domains and IP addresses should be accepted. Any valid top-level domain should be accepted, e.g. .aero and .xn--jxalpdlp. Port numbers should be allowed. URLs must be allowed in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)