|
 |
|
ใครเก่ง VB ช่วย แปลโค้ด php ในนี้เป็น ภาษา VB ให้หน่อย(Function Postdata) |
|
 |
|
|
 |
 |
|
ใครเก่ง VB ช่วย แปลโค้ด php ในนี้เป็น ภาษา VB ให้หน่อย(Function Postdata)
ก็คืออยากใช้ VB post data อะคับ php ทำเป็นแล้วเลยอยากลอง VB มั้ง
โค้ด php มีแบบนี้ครับ ช่วยแปลเป็น VB หน่อย
Code (PHP)
function postData($file) {
$dat = '';
$dat .= "-----------------------------262762878619883\r\n";
$dat .= "Content-Disposition: form-data; name=\"file\"\r\n";
$dat .= "\r\n";
$dat .= $file."\r\n";
$dat .= "-----------------------------262762878619883--\r\n";
$servers = array();
$servers[0] = array('www.domain.com','/checkpostdata.php');
$server = substr(0,count($servers)-1);
$connection = fsockopen($servers[$server][0], 80, $errorNumber, $errorString, 15);
$requestHeader = 'POST ' . $servers[$server][1] . " HTTP/0.1\r\nHost: " . $servers[$server][0] . "\r\nUser-Agent: Mozilla/0.1 (Windows; U; Windows NT 0.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/0.1\r\nReferrer: http://www.domain.com/form.php\r\nContent-Type: multipart/form-data; boundary=---------------------------262762878619883\r\nContent-Length: ".strlen($dat)."\r\n\r\n";
$requestHeader .= $dat;
fputs($connection, $requestHeader);
while (!feof($connection)) {
$data.=fgets($connection,500);
}
fclose($connection);
define('RESP_BEGIN','<center>');
define('RESP_END','</center>');
$tmp = strstr($data,RESP_BEGIN);
$resp = substr(strstr($tmp,RESP_BEGIN),strlen(RESP_BEGIN),strpos(strstr($tmp,RESP_BEGIN),RESP_END) - strlen(RESP_BEGIN));
return $resp;
}
ช่วยแปลเป็น VB หน่อยนะครับไม่ต้องละเอียดมาก ขอแค่ให้มัน postdata ติด
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-10-20 12:21:53 |
By :
bosszataroi |
View :
1635 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คห. 2 แรงมากๆ   
|
 |
 |
 |
 |
Date :
2010-03-09 17:45:38 |
By :
madoadza |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|