嘿,我正在.net 中制作激活架构。我已经编写了一个发布 PHP 变量的脚本,但是,PHP 回显了服务器响应,我想取回该响应。
我尝试了一些代码片段,但它们不起作用。
示例 php 脚本是:
<?php
$name = $_POST['username'];
echo $name;
?>
我无法得到回应,即echo $name
,我无法得到它,请帮助
我的代码是:
Dim requestStream As Stream = request.GetRequestStream()
requestStream.Write(postBuffer, 0, postBuffer.Length)
Dim stream As Stream = request.GetResponse().GetResponseStream()
Dim reader As New StreamReader(stream)
Dim response As String
Dim newStream As Stream = request.GetRequestStream()
While response = reader.ReadLine()
response += reader.ReadLine()
End While
Return response
requestStream.Close()
谢谢