Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. bool IsGoodUrl = Uri.IsWellFormedUriString(url, UriKind.Absolute);
  2.  
  3. Uri nUrl = null;
  4. if (Uri.TryCreate(url, UriKind.Absolute, out nUrl))
  5. {
  6. url = nUrl.ToString();
  7. }
  8.  
  9. if((!string.IsNullOrEmpty(TXBProductionURL.Text)) && (Uri.IsWellFormedUriString(TXBProductionURL.Text, UriKind.Absolute)))
  10. {
  11. // assign as valid URL
  12. isValidProductionURL = true;
  13.  
  14. }
  15.  
  16. public static bool Url(string p_strValue)
  17. {
  18. if (Uri.IsWellFormedUriString(p_strValue, UriKind.RelativeOrAbsolute))
  19. {
  20. Uri l_strUri = new Uri(p_strValue);
  21. return (l_strUri.Scheme == Uri.UriSchemeHttp || l_strUri.Scheme == Uri.UriSchemeHttps);
  22. }
  23. else
  24. {
  25. return false;
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement