English
Forum

InternetConnectA Problems

 

Clemens
Meier
i'm thereby, one http-Request with the POST-method to create. really ought to it functions, does it naturally not. The Lines, The the trouble imply are:
CompileMarkSeparation
hOpen& = InternetOpenA(addr(INET_CallerName$),opentype&,0,0,0)
print "hOpen "+str$(hOpen&)
hConnect& = InternetConnectA(hopen&,addr(server$),port%,addr(username$),addr(password$),INTERNET_SERVICE_HTTP&,0,0)
print "hConnect "+str$(hConnect&)pre>

The 1. row functions yet, it'll one Long-worth outputted. this worth becomes into InternetConnectA function übernommen. The variables having following values:
hopen& = 13369348 as example, get through InternetOpenA
server$ = www.einedomain.de (These Domain existing)
port% = 80
username$ = (I have it too with 0 attempts)
Password$ = (I have it too with 0 attempts)
INTERNET_SERVICE_HTTP& = 3

still the worth the zurückkommt is 0. an Internetverbindung exists. means have I yet The function internetGetLastResponseInfoA installed, as it in SDK recommended becomes. still The Fehlernummer is 0 and there's no Error Message.

has someone a idea, Why it ggf. lying could or in which direction I the Error search ought to.
 
XProfan 9.1; XP SP2; FF; Editpad
04/17/06  
 



I have your Posting moved - in the Regulars table GEHTS not circa such Programmierprobleme. Please use for Codes too the CODE, instead of the BOX - symbol.
 
04/17/06  
 



Probier time one simple:
CompileMarkSeparation
ihdl&:=InternetOpen(0,0,0,0,0)
>

and then
CompileMarkSeparation
declare server$,user$,pwdd$,mem#,data#
server$:="SERVERz"
user$:="USERNAMEz"
pwdd$:="PASSWORTz"
ftppfad$:="/"
dim mem#,4
long mem#,0:=12345
dim data#,318
clear data#
chdl&:=InternetConnect(ihdl&,addr(server$),21,addr(user$),addr(pwdd$),1,134217728,0)// 134217728 == 8000000 == INTERNET_FLAG_PASSI
on>

then can You look whether You with
CompileMarkSeparation
dhdl&:=FtpFindFirstFile(chdl&,0,addr(data#),2147483648,0)
a handle get.

my example zielt of course not Port80 ex - but the cover the Threads describe indeed one other trouble.

salvo.
 
04/17/06  
 




Clemens
Meier
Sorry, can I not try, I not XPSE install can, because moreover should I The Doku in the chm-File reading can, still The needed whom IE, the itself by me refusing something view (-> For this, Please no comments, have round 200 Euro for a MS-technician outputted, the no Solution knew and a Reinstallation Windows recommended and durchführte, by which further programs damage took Gesamtschaden round 700 Euro, dank on MS, The know, How one The economy ankurbelt)

gives it The XPSE-Documentation still in another stature, doc? html? PDF? or could one your Beispielcode in normalen XProfan run?
 
XProfan 9.1; XP SP2; FF; Editpad
04/17/06  
 




Rolf
Koch
Hi

nimm simply here The Doppelpunkte lane and already is it normal Profancode.
means instead of:
CompileMarkSeparation
Ihdl&:=Internetopen(0,0,0,0,0)
>

take You
CompileMarkSeparation
Ihdl&=Internetopen(0,0,0,0,0)
>



see it already here on whom boxing. at that downstairs becomes nothing More of XPSE displayed.
 
04/17/06  
 



with InternetOpenA should You as OpenType& rather 1 take, not 0 How in iF seinem example. Kannste Yes test times ( 1 = INTERNET_OPEN_TYPE_DIRECT )
whether one whom Agenten simply omit can white I do not, would I simply something ala: XProfan@Inet indicate
 
04/17/06  
 



You could The CHM dekompilieren.

XPSE becomes but not installs - solely from the IDE your electoral called - with the Filenames as Parameter.
 
04/17/06  
 




Clemens
Meier
class, same so many Answer, but:

an opentype changes nothing. whom Agenten To Change bring too nothing, can too empty let. I have meanwhile too an example with InternetOpenUrlA attempts, still too with this comes only a 0 out. I wealth, it's located less on the Program, separate something on my system couldn't correctly walk, though any DLLs How onl.dll or online.dll correct functions. And if it with the wininet not works, must I a others lane search.

Mmh on the Tipp The chm simply To dekompilieren had so did i from alone come can. have time a Decompiler down loaded. so becomes it well weg.
 
XProfan 9.1; XP SP2; FF; Editpad
04/17/06  
 




Clemens
Meier
means, on the system shining not To lying, have a couple hardware- and Softwaretools run, The no Error meldeten. The wininet.dll is ansprechbar and standing available, nevertheless I get always whom lever 0. have it too with the FTPFindFirstFile attempts. InternetOpenA gives seltsamerweise too always The same lever-number back. the can also not normal his. Perhaps has of/ one of you over night another idea, here time the complete code:
CompileMarkSeparation
def InternetGetLastResponseInfoA(3) !"wininet.dll","InternetGetLastResponseInfoA"
ALLGEMEINE INTERNET API-Deklarationen:
def InternetCloseHandle(1) !"wininet.dll","InternetCloseHandle"
Benötigt als Parameter hInternetHandle
def InternetConnectA(8) !"wininet.dll","InternetConnectA"
Benötigt werden:
hInternetSession als &
lpszServerName als $
nProxyPort als %
lpszUsername als $
lpszPassword als $
dwService als &
dwFlags als &
dwContext als &
def InternetOpenA(5) !"wininet.dll","InternetOpenA"
Benötigt werden:
lpszCallerName als $
dwAccessType als &
lpszProxyName als $
lpszProxyBypass als $
dwFlags als &
def InternetReadFile(4) !"wininet.dll","InternetReadFile"
Benötigt werden:
hFile als &
sBuffer als $
lNumBytesToRead als &
Bytes als &
def &INTERNET_FLAG_RELOAD  $80000000
def &INTERNET_SERVICE_HTTP  3
HTTP API-Deklarationen:
def HttpAddRequestHeadersA(4) !"wininet.dll","HttpAddRequestHeadersA"
Benötigt werden:
hHttpRequest als &
sHeaders als $
lHeadersLength als &
lModifiers als &
def HttpOpenRequestA(8) !"wininet.dll","HttpOpenRequestA"
Benötigt werden:
hInternetSession als &
lpszVerb als $
lpszObjectName als $
lpszVersion als $
lpszReferer als $
lpszAcceptTypes als &
dwFlags als &
dwContext als &
def HttpSendRequestA(5) !"wininet.dll","HttpSendRequestA"
Benötigt werden:
hHttpRequest als &
sHeaders als $
lHeadersLength als &
sOptional als $
lOptionalLength als &
declare HTTP_ADDREQ_FLAG_ADD&
declare HTTP_ADDREQ_FLAG_REPLACE&
declare INET_CallerName$
declare INET_ContentType$
declare IOTPreconfig%
declare IOTDirect%
declare IOTProxy%
declare INTERNET_FLAG_RELOAD&
declare INTERNET_SERVICE_HTTP&
HTTP_ADDREQ_FLAG_ADD& = $20000000
HTTP_ADDREQ_FLAG_REPLACE& = $80000000
INET_CallerName$ = "Testzugriff"
INET_ContentType$ = "Content-Type: application/x-www-form-urlencoded
"
IOTPreconfig% = 0
IOTDirect% = 1
IOTProxy% = 3
INTERNET_FLAG_RELOAD& = $80000000
INTERNET_SERVICE_HTTP& = 3
declare string$,url$,data$

Proc HttpPost

    Aufruf
    Parameters url$,data$,opentype&,port%,username$,password$
    Declare  server$,path$,hOpen&,hConnect&,hRequest&,Buffer#,Bytes&,i&,ende%,httppost$
    declare errorbuffer#,error&
    DIM Buffer#,2048
    DIM errorbuffer#,2048
    url$ = trim$(url$)

    if (lower$(left$(url$,7)) = "https://")

        url$ = right$(url$,len(url$)-7)

    endif

    i& = InStr("/",url$)

    if (i& > 0)

        server$ = left$(url$,i&-1)
        path$ = right$(url$,len(url$)-i&+1)

    else

        server$ = url$
        path$ = "/"

    endif

    print "Server: "+server$
    print "Pfad: "+path$
    hOpen& = InternetOpenA(addr(INET_CallerName$),opentype&,0,0,0)
    print "hOpen "+str$(hOpen&)
    hConnect& = InternetConnectA(hopen&,addr(server$),port%,addr(username$),addr(password$),INTERNET_SERVICE_HTTP&,0,0)
    print "hConnect "+str$(hConnect&)
    hRequest& = HttpOpenRequestA(hConnect&,"POST",addr(path$),"HTTP/1.0",0,0,INTERNET_FLAG_RELOAD&,0)
    print "hRequest "+str$(hRequest&)

    if (hRequest& = 0)

        InternetGetLastResponseInfoA(addr(error&),addr(errorbuffer#),sizeof(errorbuffer#))
        print str$(error&)
        print "Info: "+string$(errorbuffer#,0)
        waitinput
        dispose buffer#
        dispose errorbuffer#
        end

    endif

    Header
    HttpAddRequestHeadersA(hRequest&,addr(INET_ContentType$),len(INET_ContentType$),HTTP_ADDREQ_FLAG_REPLACE& | HTTP_ADDREQ_FLAG_ADD&)
    HttpSendRequestA(hRequest&,0,0,addr(data$),len(data$))
    ende% = 1

    repeat

        print "a"
        InternetReadFile(hRequest&,addr(buffer#),sizeof(buffer#),addr(Bytes&))

        if (bytes& = 0)

            ende% = 0

        else

            httppost$ = char$(buffer#,0,bytes&)

        endif

    until ende% = 0

    InternetCloseHandle(hRequest&)
    InternetCloseHandle(hConnect&)
    InternetCloseHandle(hOpen&)
    dispose buffer#
    dispose errorbuffer#
    return httppost$

endproc

CLS
url$ = "https://www.colored-web.com/httppost/index.php"
data$ = "X=15&Y=29"
string$ = HttpPOST(url$,data$,1,80,"","")
print
tring$ waitinput end
 
XProfan 9.1; XP SP2; FF; Editpad
04/17/06  
 




Rolf
Koch
Hi,
Have hither and thither tested.
The Bruchstücke Code iF are me famous, there we then together above spoken had.

iFs code was in the principle identical but it running in the Contrast To Your (means built a FTP link on and listete data on).

can it his, that somehow the Server this all not so likes?
 
04/18/06  
 




Clemens
Meier
no, on the Server shining not To lying, have it even with two further Servern on different Standorten probiert, still too with them comes always exakt the same Result out.

has Perhaps someone one working Prog with InternetOpenA means with Api-functions from the wininet.dll, The I then by me time try can?
 
XProfan 9.1; XP SP2; FF; Editpad
04/18/06  
 



Have I supra posted?
 
04/18/06  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

5.451 Views

Untitledvor 0 min.
Walter11/08/20
Erasmus.Herold01/15/19
Andre Rohland09/04/16
Untitled03/22/12

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie