c# - Using a pre-existing PHP script to upload images to a server -


i'm creating winform application need upload image files central image server. before this, there pre-existing php script has been written allow images uploaded server via web portal. i've been told can make program access php script , use functionality.

how possible?

so far i've tried following lines of code:

iphostentry iphostinfo = system.net.dns.gethostentry("http://scriptlocation.html"); ipaddress ipaddress = iphostinfo.addresslist[0];  using (tcpclient client = new tcpclient()) {    client.connect(ipaddress, 21);    client.sendtimeout = 3000;    var status = client.connected;    lblstatus.text = status.tostring();    console.writeline(status); } 

but when run following error;

no such host known

i'm new network programming this, please point me in right direction?

if understand correctly trying send file http.

consider using webclient:

using(var wc = new webclient()) {     wc.uploaddata("http://scriptlocation.html", "post", data); } 

where data file byte array;


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -