You can use the
System.Uri
class to parse the URI and extract the desired information.
siteInfo.wsdlUri = ConfigurationManager.AppSettings["uri"].ToString();
string uri = siteInfo.wsdlUri;
System.Uri parsedUri;
if (Uri.TryCreate(uri, UriKind.Absolute, out parsedUri))
{
siteInfo.wsdlUri.UserId = parsedUri.QueryParameters["UserId"];
siteInfo.wsdlUri.MemberId = parsedUri.QueryParameters["MemberId"];
}
else
{
Console.WriteLine("Invalid URI format");
}
If the URI doesn't contain query parameters, and the information is encoded in a different way, you'll need to adjust the parsing logic accordingly.