本文整理汇总了C#中DataBase.POST方法的典型用法代码示例。如果您正苦于以下问题:C# DataBase.POST方法的具体用法?C# DataBase.POST怎么用?C# DataBase.POST使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataBase
的用法示例。
在下文中一共展示了DataBase.POST方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start()
{
/*JSONObject j = new JSONObject (JSONObject.Type.OBJECT);
j.AddField ("num", "0.5");
j.AddField ("mondai", "korehanani");
JSONObject arr = new JSONObject (JSONObject.Type.ARRAY);
j.AddField ("kaito", arr);
arr.Add (1);
arr.Add (2);
arr.Add (3);
string encoded = j.print ();
Debug.Log (encoded);
JSONObject str = new JSONObject (encoded);
accessData (str);*/
WWWForm form = new WWWForm ();
form.AddField("anss[]", 1);
form.AddField("anss[]", 4);
form.AddField("setno", 1);
string url = "http://hanamaroid-quiz.herokuapp.com/post";
db = GameObject.Find ("DataBase").GetComponentInChildren<DataBase> ();
string results = db.POST (url, form).ToString ();
Debug.Log (results);
}
示例2: Start
// Use this for initialization
void Start()
{
string loginID = GameObject.Find ("data").GetComponent<data> ().loginID;
string password = GameObject.Find ("data").GetComponent<data> ().Passward;
//GameObject.Find("data").GetComponent<data>().ID.Add(loginID, 1);//IDを1にする
WWWForm form = new WWWForm ();
form.AddField ("name", loginID);
form.AddField ("userid", password);
string url = "http://hanamaroid-quiz.herokuapp.com/createu";
db = GameObject.Find ("DataBase").GetComponentInChildren<DataBase> ();
string results = db.POST (url, form).ToString ();
Debug.Log (results);
}
示例3: Start
// Use this for initialization
void Start()
{
//string loginID = GameObject.Find ("data").GetComponent<data> ().loginID;
//string password = GameObject.Find ("data").GetComponent<data> ().Passward;
//int Result = GameObject.Find ("data").GetComponent<data> ().Result;
//GameObject.Find("data").GetComponent<data>().ID.Add(loginID, 1);//IDを1にする
WWWForm form = new WWWForm ();
//Result = 4;////////
string name = GameObject.Find("data").GetComponent<data>().loginID;
string setno;
int subject = GameObject.Find("data").GetComponent<data>().subject;
if(subject == 0) setno = "sci";
else setno = "soc";
int grade = GameObject.Find("data").GetComponent<data>().grade;
if(grade == 0) setno += "101";
else if(grade == 1) setno += "201";
else setno += "301";
string percent = (GameObject.Find("data").GetComponent<data>().Result*10).ToString();
form.AddField ("name", name);
form.AddField ("percent", percent);//(Result*10).ToString());
form.AddField ("setno", setno);
string url = "http://hanamaroid-quiz.herokuapp.com/cal_ranking";
db = GameObject.Find ("DataBase").GetComponentInChildren<DataBase> ();
//string results = db.POST (url, form).ToString ();
//Debug.Log (results);
GameObject.Find("data").GetComponent<data>().Ranking = db.POST (url, form).ToString ();
//guiText.text = db.POST (url, form).ToString ();
guiText.text = percent + "%";
//results = "{\"name\":\"sci101\",\"ranking\":6,\"total\":20}";
//JSONObject j = new JSONObject (results);
//Debug.Log(j[1]);
//access data (and print it)
}