Click here to Skip to main content
15,886,919 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHttp Request without ASP.NET? Pin
Sonhospa11-Jul-12 2:34
Sonhospa11-Jul-12 2:34 
AnswerRe: Http Request without ASP.NET? Pin
Luc Pattyn11-Jul-12 3:36
sitebuilderLuc Pattyn11-Jul-12 3:36 
GeneralRe: Http Request without ASP.NET? Pin
Sonhospa11-Jul-12 4:18
Sonhospa11-Jul-12 4:18 
AnswerRe: Http Request without ASP.NET? Pin
Luc Pattyn11-Jul-12 4:32
sitebuilderLuc Pattyn11-Jul-12 4:32 
GeneralRe: Http Request without ASP.NET? Pin
Sonhospa11-Jul-12 6:03
Sonhospa11-Jul-12 6:03 
AnswerRe: Http Request without ASP.NET? Pin
Luc Pattyn11-Jul-12 6:44
sitebuilderLuc Pattyn11-Jul-12 6:44 
QuestionRe: Http Request without ASP.NET? Pin
Sonhospa11-Jul-12 9:12
Sonhospa11-Jul-12 9:12 
AnswerRe: Http Request without ASP.NET? Pin
Luc Pattyn11-Jul-12 10:23
sitebuilderLuc Pattyn11-Jul-12 10:23 
OK, I looked into this matter somewhat closer, and here are my findings and suggestions, they may not suffice to get anything fixed though.

1.
HttpContext is a class inside System.Web, adding a reference to that and including an Imports should take care of it.

2.
Request is more complicated; you get it for free in an ASP.NET application, as a member of the Page.
And it also exists inside HttpApplication (which requires 3.5 or above), not sure that could help.

3.
The ZIPped code is performing a POST as soon as a page loads; if I understand correctly, it is the app requesting a page, then when that loads, posting the last request with something added; so you probably don't need the incoming request (as it must equal the request you launched just before), you could probably post right away what it is you need posted.

4.
My regular POST code looks like this in C#, the same could be handled in VB.NET; inputs are two strings (URL and postMessage):
	HttpWebRequest req=(HttpWebRequest)WebRequest.Create(URL);
#if WITH_NETWORK_CREDENTIAL
// optional proxy stuff goes here
#endif
	if (postMessage!=null) {
		byte[] bytes=Encoding.UTF8.GetBytes(postMessage);
		int length=bytes.Length;
		req.ContentLength=length;
		req.ContentType="application/x-www-form-urlencoded";
		req.Method="POST";
		Stream stream=req.GetRequestStream();
		stream.Write(bytes, 0, length);
		stream.Close();
	}
	// and now use the request, i.e. process the response
	HttpWebResponse resp=(HttpWebResponse)req.GetResponse();
	using (Stream stream=resp.GetResponseStream()) {
		// whatever it takes to consume the response goes here
	}


5.
As you already said, I'm afraid a WinForms app isn't the right environment to perform IPN operations. I once looked into IPN from a web shop point of view, which meant the server side. The server would always be up and ready to react on PayPal's notifications. At that time, I browsed a WROX book "Web APIS with PHP" which discussed a number of API's including PayPal's, from the server's point of view; and obviously the examples all use PHP, not any of the .NET languages. However I never implemented any part of the PayPal functionality, and
I never became really familiar with the protocols.

6.
There are quite a lot of PayPal articles here at CP, and yes most if not all talk about ASP.NET; you might get some help by finding the closest match to what you want, then ask in the article's forum.

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

NewsRe: Http Request without ASP.NET? Pin
Sonhospa11-Jul-12 12:09
Sonhospa11-Jul-12 12:09 
AnswerRe: Http Request without ASP.NET? Pin
Luc Pattyn11-Jul-12 12:24
sitebuilderLuc Pattyn11-Jul-12 12:24 
QuestionHow to Inverse a Matrix in VBA ? Pin
caokeguan10-Jul-12 17:45
caokeguan10-Jul-12 17:45 
AnswerRe: How to Inverse a Matrix in VBA ? Pin
Sonhospa11-Jul-12 4:32
Sonhospa11-Jul-12 4:32 
AnswerRe: How to Inverse a Matrix in VBA ? Pin
Luc Pattyn11-Jul-12 4:42
sitebuilderLuc Pattyn11-Jul-12 4:42 
Generaltask manager Pin
aliali7410-Jul-12 8:14
aliali7410-Jul-12 8:14 
GeneralRe: task manager Pin
Dave Kreskowiak10-Jul-12 8:22
mveDave Kreskowiak10-Jul-12 8:22 
GeneralRe: task manager Pin
Wes Aday10-Jul-12 9:35
professionalWes Aday10-Jul-12 9:35 
QuestionProperty changed event in standard control Pin
908236510-Jul-12 6:28
908236510-Jul-12 6:28 
AnswerRe: Property changed event in standard control Pin
Sonhospa10-Jul-12 8:11
Sonhospa10-Jul-12 8:11 
AnswerRe: Property changed event in standard control Pin
Eddy Vluggen10-Jul-12 9:18
professionalEddy Vluggen10-Jul-12 9:18 
GeneralRe: Property changed event in standard control Pin
908236511-Jul-12 9:03
908236511-Jul-12 9:03 
GeneralRe: Property changed event in standard control Pin
Dave Kreskowiak11-Jul-12 9:11
mveDave Kreskowiak11-Jul-12 9:11 
GeneralRe: Property changed event in standard control Pin
908236511-Jul-12 11:52
908236511-Jul-12 11:52 
GeneralRe: Property changed event in standard control Pin
_obi_1-Aug-12 7:31
_obi_1-Aug-12 7:31 
QuestionHelo Guys i need your help Pls Pin
samfrancis10-Jul-12 1:18
samfrancis10-Jul-12 1:18 
AnswerRe: Helo Guys i need your help Pls Pin
Nick Otten10-Jul-12 2:36
Nick Otten10-Jul-12 2:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.