public int setURL(string sURL, string sUser, string sPass, string sType)
{
NetworkCredential netCreds = new NetworkCredential(sUser, sPass);
CredentialCache credCache = new CredentialCache();
credCache.Add(new Uri(sURL), sType, netCreds);
HttpWebRequest oWebReq = (HttpWebRequest)WebRequest.Create(sURL);
oWebReq.Credentials = credCache;
int iResult = 0;
try
{
HttpWebResponse oWebRes = (HttpWebResponse)oWebReq.GetResponse();
oSugarCRM.Url = sURL;
iResult = 1;
}
catch (Exception ex)
{
iResult = 0;
}
return iResult;
}