3
有没有更好的方式来验证C#字符串是否是比以下有效的xs:anyURI?将C#字符串验证为有效的XML模式anyURI
public bool VerifyAnyURI(string anyUriValue)
{
bool result = false;
try
{
SoapAnyUri anyUri = new SoapAnyUri(anyUriValue);
result = true;
}
catch (Exception)
{
}
return result;
}
这个构造函数似乎不会抛出任何类型的异常。任何有效的字符串在技术上都是有效的anyURI?