当前位置: 首页>>代码示例>>C#>>正文


C# DataBase.POST方法代码示例

本文整理汇总了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);
    }
开发者ID:nosaj0926,项目名称:4takuhakase,代码行数:28,代码来源:PostTest.cs

示例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);
    }
开发者ID:nosaj0926,项目名称:4takuhakase,代码行数:15,代码来源:PostAddAccount.cs

示例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)
    }
开发者ID:nosaj0926,项目名称:4takuhakase,代码行数:41,代码来源:PostResult.cs


注:本文中的DataBase.POST方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。