ちょっと調べたらこのページにたどり着きました。ここでは、C# 文字列を PHP ページに送信するコードをいくつか見つけました。
ただし、自分のプログラムに実装した後は機能しませんでした。これが私のコードです:
private void executesend()
{
using (WebClient client = new WebClient())
{
client.UploadString(url,"POST",keys);
}
}
PHPの部分については、次のものがあります。
<?php
mysql_connect("localhost", "", "") or die(mysql_error()); // Connect to database server(localhost) with username and password.
mysql_select_db("dimittv89_dayz") or die(mysql_error()); // Select registration database.
$name = $_GET["message"];
if ( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
$name = file_get_contents('php://input');
$opdracht = "INSERT INTO 'keys', (`key`) VALUES ('$name')";
print $name;
}
if (mysql_query($opdracht)){
echo "succesfully registerd to the melloniax u wil now be returned to our main page";
}
else{
echo "hey something went wrong there ! please try again in a minute";
}
?>
同じトピックで、ユーザーの 1 人もこれを試すように言っています。
php?fmessage=testtesttest"
を使用して出力を書き留めます
$name = $_GET["message"];
print $name;
これもうまくいきませんでした。私は何か間違ったことをしていますか?
すでに助けてくれてありがとう
まあ、私はそれが間違っている送信値ではなく、取得値であることがわかりました:
Username = Registry.CurrentUser.OpenSubKey("Username", true);
Name = "" + Username.GetValue("Uid");
regedit メニューでは、値が REG_BINARY であると表示されていますが、これらは getvalue で読み取ることができますか?