“URL yang valid di .net” Kode Jawaban

URL yang valid di .net

//Try this to validate HTTP URLs (url is the URI you want to test):
//
	// Checks how well a url validator does against a known list of valid and invalid Urls
	// The sample urls here are from http://formvalidation.io/validators/uri
	//	
// test 
/// in text this only one that most low (17) error
public static bool UrlChecker5(string url)
	{
		Uri uriResult;
		bool result = Uri.TryCreate(url, UriKind.Absolute, out uriResult) 
			&& (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps);
       return result;
	}
// and than (17)

public static bool UrlChecker2(string url)
	{
		return Uri.IsWellFormedUriString(url, UriKind.Absolute);
	}
// if we combine both with like UrlChecker5(url) && UrlChecker2(url)
// error become lowest 15 error

code fighter

URL yang valid check in c#

public static bool CheckURLValid(this string source) => Uri.TryCreate(source, UriKind.Absolute, out Uri uriResult) && uriResult.Scheme == Uri.UriSchemeHttps;
Enchanting Elephant

Jawaban yang mirip dengan “URL yang valid di .net”

Pertanyaan yang mirip dengan “URL yang valid di .net”

Lebih banyak jawaban terkait untuk “URL yang valid di .net” di C#

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya