【发布时间】:2015-04-22 15:40:06
【问题描述】:
您好,我希望使用标头将统一项目中的值推送到 ASPX 字符串中。我想知道如何做到这一点。我可以在 PHP 中使用简单的 $_Request(ID) 来完成,然后使用类似
using UnityEngine;
using System.Collections;
public class NewSession : MonoBehaviour {
string userLoginFile = "http://local/UnitySQL/NewSession.php?UserId=";
public UnityEngine.UI.Text NewSess;
string userid = "";
string session = "";
void OnGUI()
{
session = NewSess.text;
userid = PlayerPrefs.GetString ("UserId");
}
public void Insert()
{
if (session == "") {
Application.OpenURL (userLoginFile +userid);
//StartCoroutine (LoginUser (userid));
} else {
print("DAMNSON");
}
}
/*IEnumerator LoginUser(string user)
{
WWW login = new WWW (userLoginFile + "UserId=" + user);
print (userLoginFile + "UserId=" + user);
yield return login;
if (login.error == null)
{
string[] credentials = login.text.Split('/');
foreach(string str in credentials)
{
string[] creds = str.Split ('=');
for(int i=0; i < creds.Length; i++)
{
print ("winner");
}
}
}
}*/
}
Then the PHP would just be a simple
$userid = $_REQUEST['UserId'];
UID = $_REQUEST(ID);
我想知道如何使用 C# 提前致谢
【问题讨论】:
-
ASPX 字符串是什么意思?您的问题目前写的非常不清楚。
-
请贴出你写到现在的代码。那么,帮助你就更容易了。