I created a C# dll that get quote information from an external site. The url that is generated works through a regular browser but then I use the DLL (from an old FoxPro app), I get a "The remote server returned an error: (400) Bad Request." error. Here is the code I'm using in the DLL.
string uri=" + ConnStr.ToString();
System.Uri weburi = new System.Uri(uri,true);
try
{
System.Net.HttpWebRequest webrequest = (HttpWebRequest)System.Net.WebRequest.Create(weburi);
WebProxy myProxy=new WebProxy();
// Obtain the 'Proxy' of the Default browser.
myProxy=(WebProxy)webrequest.Proxy;
myProxy.Credentials = new NetworkCredential("internetuser", "internetuser", "corp");
webrequest.Proxy = myProxy;
System.Net.HttpWebResponse webresponse = (HttpWebResponse) webrequest.GetResponse();
.
.
.
Any suggestions? I have gotten the url that is passed and put it in my browser without any problem. I have referenced the dll in a .NET console app without any problems.
Thanks in advance.
string uri=" + ConnStr.ToString();
System.Uri weburi = new System.Uri(uri,true);
try
{
System.Net.HttpWebRequest webrequest = (HttpWebRequest)System.Net.WebRequest.Create(weburi);
WebProxy myProxy=new WebProxy();
// Obtain the 'Proxy' of the Default browser.
myProxy=(WebProxy)webrequest.Proxy;
myProxy.Credentials = new NetworkCredential("internetuser", "internetuser", "corp");
webrequest.Proxy = myProxy;
System.Net.HttpWebResponse webresponse = (HttpWebResponse) webrequest.GetResponse();
.
.
.
Any suggestions? I have gotten the url that is passed and put it in my browser without any problem. I have referenced the dll in a .NET console app without any problems.
Thanks in advance.