|
Posted by Kahuna on 08/17/05 22:12
"NC" <nc@iname.com> wrote in message
news:1124297141.093330.257510@o13g2000cwo.googlegroups.com...
> Kahuna wrote:
>>
>> I have a VB app that generates a PC fingerprint ID. I'd like to pass this
>> fingerprint directly from the app, over the web, to a PHP Page that will
>> generate a 'legal' password / key and return it to the app.
>>
>> I guess I need to generate a URL with the required data attached as
>> variables together with the variable values. That much I know.
>>
>> My challenge is, how do I pass that URL from VB (and this is probably for
>> the VB guru's to help with) without it firing up IE?
>>
>> Next challenge. So, lets assume I have the fingerprint in PHP script and
>> it
>> has generated the response key. How do I get that info back into my app
>> directly? Again avoiding IE interface.
>
> OK, let's say that you have a PHP script that accepts a fingerprint ID
> via GET and spits back the password. So here's what you need to do in
> this case:
>
> 1. URLencode your fingerprint ID.
>
> 2. Append it to your script's URL, so that your URL looks
> something like this:
>
>
> http://yoursite.com/path/script.php?id=your_fingerprint_ID_URLencoded
>
> 3. Do something like this in VB (copied almost verbatim from
> "VB.NET Programmer's Cookbook" by Matthew MacDonald):
>
> Dim URL As Sting = "your_URL";
> Dim Req As HttpWebRequest = _
> CType(WebRequest.Create(URL), HttpWebRequest)
> Dim Resp As WebResponse = Req.GetResponse()
> Dim R As New StreamReader(Resp.GetResponseStream())
> Dim Page As String = R.ReadToEnd()
> R.Close()
>
> Now the Page variable contains whatever the PHP script returned
> (including HTTP headers, if I remember correctly). All you need
> to do is to find the password in the response.
>
> Cheers,
> NC
Thanks NC
After posting I figured I'd end-up with a direct VB solution.
I'll probably end-up with the InternetTranfer methods, but thought there
might be a more robust PHP solution to what I needed (being brandy newbie on
PHP).
Much appreciate your effort, sorry about the diatribe you had to put up with
from the 'Square' nutter on this newsgroup! Takes all sorts I guess, I am
just amazed he's decided to follow a tread he's got no interest in!
Cheers
--
Kahuna
------------
Navigation:
[Reply to this message]
|