Prev: Using a Proc at a location obtained with GetProcAddress (win32api) in VB6
Next: Run commandline file from vb6 and read the output
From: Alain B on 26 Sep 2007 10:25 I have two applications, one using VB.net and one using VB 6.0. To http access a protected apache server with VB.Net, I do: public string CreateRequestURL(string baseURL) { StringBuilder sb = new StringBuilder(baseURL).Append(String.Format(urlAppendix,_userID,PartNumber)); return sb.ToString(); } public System.Net.HttpWebRequest GetWebRequest(string baseURL) { System.Net.HttpWebRequest req = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(new Uri(CreateRequestURL(baseURL))); req.Method = "GET"; req.UserAgent = RequestConstants.USER_AGENT; req.Credentials = new System.Net.NetworkCredential(_userID, _password); return req; } This is working great but only on VB.net Visual Studio 2005 But I can't find any information on how to duplicate this Credentials/ security with the old VB 6.0 technilogy when using MSXL2.DOMDocument in a dom.async way. Do I need to set the dom.setProperty, how? For reason of time, I can't move the VB 6.0 application to .net technology; is there a way to supply the _userID, _password to apache server at the connection level (not in the URL statement which is not working)? Thank you for pointer, or link that I may have missed.
From: Randy Birch on 26 Sep 2007 18:51 Does passing the user and pw in the url work? ... http://username:password(a)www.whatever.com -- Randy Birch MS MVP, Visual Basic http://vbnet.mvps.org/ Please respond to the newsgroups so all can benefit. "Alain B" <alain.butzberger(a)mwaintel.com> wrote in message news:1190816715.907332.179690(a)y42g2000hsy.googlegroups.com... I have two applications, one using VB.net and one using VB 6.0. To http access a protected apache server with VB.Net, I do: public string CreateRequestURL(string baseURL) { StringBuilder sb = new StringBuilder(baseURL).Append(String.Format(urlAppendix,_userID,PartNumber)�); return sb.ToString(); } public System.Net.HttpWebRequest GetWebRequest(string baseURL) { System.Net.HttpWebRequest req = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(new Uri(CreateRequestURL(baseURL))); req.Method = "GET"; req.UserAgent = RequestConstants.USER_AGENT; req.Credentials = new System.Net.NetworkCredential(_userID, _password); return req; } This is working great but only on VB.net Visual Studio 2005 But I can't find any information on how to duplicate this Credentials/ security with the old VB 6.0 technilogy when using MSXL2.DOMDocument in a dom.async way. Do I need to set the dom.setProperty, how? For reason of time, I can't move the VB 6.0 application to .net technology; is there a way to supply the _userID, _password to apache server at the connection level (not in the URL statement which is not working)? Thank you for pointer, or link that I may have missed.
From: Alain B on 28 Sep 2007 10:41 On Sep 26, 3:51 pm, "Randy Birch" <rgb_removet...(a)mvps.org> wrote: > Does passing the user and pw in the url work? ... I did state this on my original post: "not in the URL statement, which is not working" Maybe the only way is to write a .net wrapper for that function alone, but before .net how people where doing this?
From: Randy Birch on 28 Sep 2007 20:44
Sorry -- missed that tidbit. -- Randy Birch MS MVP, Visual Basic http://vbnet.mvps.org/ Please respond to the newsgroups so all can benefit. "Alain B" <alain.butzberger(a)mwaintel.com> wrote in message news:1190990481.049571.79590(a)50g2000hsm.googlegroups.com... On Sep 26, 3:51 pm, "Randy Birch" <rgb_removet...(a)mvps.org> wrote: > Does passing the user and pw in the url work? ... I did state this on my original post: "not in the URL statement, which is not working" Maybe the only way is to write a .net wrapper for that function alone, but before .net how people where doing this? |