Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool IsGoodUrl = Uri.IsWellFormedUriString(url, UriKind.Absolute);
- Uri nUrl = null;
- if (Uri.TryCreate(url, UriKind.Absolute, out nUrl))
- {
- url = nUrl.ToString();
- }
- if((!string.IsNullOrEmpty(TXBProductionURL.Text)) && (Uri.IsWellFormedUriString(TXBProductionURL.Text, UriKind.Absolute)))
- {
- // assign as valid URL
- isValidProductionURL = true;
- }
- public static bool Url(string p_strValue)
- {
- if (Uri.IsWellFormedUriString(p_strValue, UriKind.RelativeOrAbsolute))
- {
- Uri l_strUri = new Uri(p_strValue);
- return (l_strUri.Scheme == Uri.UriSchemeHttp || l_strUri.Scheme == Uri.UriSchemeHttps);
- }
- else
- {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement