Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Modification d'un fichier sur un site web avec winsock

1 réponse
Avatar
Fabien Gouverneur
Bonjour à tous !

Voici le source de mon projet actuel :

Private sub Form_load()
Winsock_xml.remote host = "agro13.cjb.net"
Winsock_xml.remoteport = 80
Winsock_xml.connect
end sub

Private sub winsock_xml_connect ()

Dim strcommand as string
Dim strwebpage as string

strwebpage = http://agro13.cjb.net/actus.xml
strcommand = "GET " + strwebpage + vbcrlf
strcommand = strcommand + "Accept: */*" + vbcrlf
strcommand = strcommand + "Accept : text/xml" + vbcrlf
strcommand = strcommand + vbcrlf

Winsock_xml.sendData strcommand

end sub

Private sub winsock_xml_dataarrival(byval bytestotal as long)

dim xml_data as string

Winsock_xml.getdata xml_data, vbstring
text1.text = text1.text + xml_data

End sub

Ceci me permet de récupérer dans un textbox le source de mon fichier
actus.xml

Ce que je cherche à faire c'est pouvoir modifier hors ligne mon fichier,
puis le renvoyer sur le site (le serveur) - il faut donc que j'écrase le
précédent fichier .

Avez vous une idée ?

Merci pour votre aide.
Fabien

1 réponse

Avatar
jean-marc
"Fabien Gouverneur" wrote in message
news:4294618e$0$12033$
Bonjour à tous !

Voici le source de mon projet actuel :

Private sub Form_load()
Winsock_xml.remote host = "agro13.cjb.net"
Winsock_xml.remoteport = 80
Winsock_xml.connect
end sub

Private sub winsock_xml_connect ()

Dim strcommand as string
Dim strwebpage as string

strwebpage = http://agro13.cjb.net/actus.xml
strcommand = "GET " + strwebpage + vbcrlf
strcommand = strcommand + "Accept: */*" + vbcrlf
strcommand = strcommand + "Accept : text/xml" + vbcrlf
strcommand = strcommand + vbcrlf

Winsock_xml.sendData strcommand

end sub

Private sub winsock_xml_dataarrival(byval bytestotal as long)

dim xml_data as string

Winsock_xml.getdata xml_data, vbstring
text1.text = text1.text + xml_data

End sub

Ceci me permet de récupérer dans un textbox le source de mon fichier
actus.xml

Ce que je cherche à faire c'est pouvoir modifier hors ligne mon fichier,
puis le renvoyer sur le site (le serveur) - il faut donc que j'écrase le
précédent fichier .



Hello,

pourquoi pas par FTP? C'est sans doute le plus facile.
Tu peux soit utiliser un composant dédié, soit implémenter le minimum du
protocole FTP
et utiliser ton winsock.

--
Jean-marc