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


C# WWWForm.AddField方法代码示例

本文整理汇总了C#中UnityEngine.WWWForm.AddField方法的典型用法代码示例。如果您正苦于以下问题:C# WWWForm.AddField方法的具体用法?C# WWWForm.AddField怎么用?C# WWWForm.AddField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.WWWForm的用法示例。


在下文中一共展示了WWWForm.AddField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Balance

 /**
  * Authenticated resource which returns the current balance of the player in Bitcoins
  */
 public void Balance(string name, string pass, Action<JSONObject> success, Action<string> error)
 {
     WWWForm form = new WWWForm();
     form.AddField("name", name);
     form.AddField("pass", Util.Encrypt(pass));
     t.Get("player/balance", form, success, error);
 }
开发者ID:imclab,项目名称:coinding-api-unity,代码行数:10,代码来源:Player.cs

示例2: Authenticate

        public IEnumerator Authenticate(string gameId, string hostname, int httpPort, string username, string password, Success success, Error error)
        {
            string prefix;
            if (NetworkSettings.instance.httpUseSSL) {
                prefix = "https://";
            } else {
                prefix = "http://";
            }

            string uri = prefix + hostname + ":" + httpPort + "/api/client/login/" + gameId;
            //Debug.Log ("Authenticating via " + uri);
            var form = new WWWForm ();
            form.AddField ("username", username);
            form.AddField ("password", password);
            WWW www = new WWW (uri, form.data, form.headers);
            yield return www;

            if (www.error != null) {
                Debug.Log(www.error);
                error (www.error);
            } else {
                //Debug.Log(www.text);
                Dictionary<string, string> values = JsonConvert.DeserializeObject<Dictionary<string, string>> (www.text);
                success (values);
            }
        }
开发者ID:gamemachine,项目名称:gamemachine,代码行数:26,代码来源:Authentication.cs

示例3: Balance

 /**
  * Authenticated resource which returns the current balance of the developer in Bitcoins
  */
 public void Balance(string email, string pass, Action<JSONObject> success, Action<string> error)
 {
     WWWForm form = new WWWForm();
     form.AddField("email", email);
     form.AddField("pass", Util.Encrypt(pass));
     t.Get("developer/balance", form, success, error);
 }
开发者ID:imclab,项目名称:coinding-api-unity,代码行数:10,代码来源:Developer.cs

示例4: AddParams

		private WWWForm AddParams()
		{
			WWWForm form = new WWWForm();
			form.AddField( GameConstants.REQUEST_KEY_API_KEY, Encryption.API_KEY);
			form.AddField( GameConstants.REQUEST_KEY_TIMESTAMP, "" + (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond));
			return form;
		}
开发者ID:SonGit,项目名称:NailGame,代码行数:7,代码来源:BaseRequest.cs

示例5: Register

 /**
  * Creates a new player account
  */
 public void Register(string name, string pass, Action<JSONObject> success, Action<string> error)
 {
     WWWForm form = new WWWForm();
     form.AddField("name", name);
     form.AddField("pass", Util.Encrypt(pass));
     t.Post("player/register", form, success, error);
 }
开发者ID:imclab,项目名称:coinding-api-unity,代码行数:10,代码来源:Player.cs

示例6: GetNewTrades

        IEnumerator GetNewTrades()
        {
            WWWForm form = new WWWForm();
            form.AddField("_Token", APIKey); //The token
            form.AddField("Symbols", symbols); //The Symbols you want
            DateTimeOffset currentTimeEST = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, easternZone);

            
            form.AddField("StartDateTime", lastUpdatedEST.ToString(timeFormat)); //The proper DateTime in the proper format
            form.AddField("EndDateTime", currentTimeEST.AddTicks(-1000000).ToString(timeFormat)); //The proper DateTime in the proper format
            var url = "http://ws.nasdaqdod.com/v1/NASDAQTrades.asmx/GetTrades HTTP/1.1";

            WWW www = new WWW(url, form);
            yield return www;
            if (www.error == null)
            {
                //Sucessfully loaded the JSON string
                Debug.Log("Loaded following JSON string" + www.text);

            }
            else
            {
                Debug.Log("ERROR: " + www.error);
            }
        }
开发者ID:chen-ye,项目名称:SoundStockUnity,代码行数:25,代码来源:StockManager.cs

示例7: Register

 /**
  * Adds a new game to the network
  */
 public void Register(string name, string dev, string url, Action<JSONObject> success, Action<string> error)
 {
     WWWForm form = new WWWForm();
     form.AddField("name", name);
     form.AddField("dev", dev);
     form.AddField("url", url);
     t.Post("game/register", form, success, error);
 }
开发者ID:imclab,项目名称:coinding-api-unity,代码行数:11,代码来源:Game.cs

示例8: Login

        public void Login(string username, string password)
        {
            WWWForm form = new WWWForm();
            form.AddField("username", username);
            form.AddField("password", password);

            httpService.HttpPost(LOGIN_URL, form, LoginCallback);
        }
开发者ID:maximecharron,项目名称:GLO-3002-Frima,代码行数:8,代码来源:LoginService.cs

示例9: Register

        public void Register(string username, string password, string email)
        {
            WWWForm form = new WWWForm();
            form.AddField("username", username);
            form.AddField("password", password);
            form.AddField("email", email);

            httpService.HttpPost(REGISTRATION_URL, form, RegistrationCallback);
        }
开发者ID:maximecharron,项目名称:GLO-3002-Frima,代码行数:9,代码来源:RegistrationService.cs

示例10: AccountLoginCorrect

    public void AccountLoginCorrect(string username, string pwd)
    {
        string salt = "";
        string CorrectHashedPwd = "";
        string answer = "";
        password = pwd;

        UnityEngine.WWWForm form = new UnityEngine.WWWForm();
        form.AddField("Command", "GetHashSalt");
        form.AddField("acctName", username);
        WWWLoader.instance.myDelegate += OnGetHashAndSalt;
        WWWLoader.Load("http://unitytowerdefense.com/WebService.php", form);
    }
开发者ID:keaton-freude,项目名称:UnityTowerDefense,代码行数:13,代码来源:UTDDatabase.cs

示例11: SendData

        //Data is sent using HTTP GET
        public void SendData(string data)
        {
            WWWForm formData = new WWWForm();
            formData.AddField("userid", _ID);
            formData.AddField("appversion", _AppVersion);
            formData.AddField("data", data);

            if (Reta.DEBUG_ENABLED && Reta.Instance.onDebugLog != null)
                Reta.Instance.onDebugLog("[Reta] Sending Data " + data + " to " + _ID);

            //Create URL
            StartCoroutine(SendingData(formData));
        }
开发者ID:hitnoodle,项目名称:Reta-Client,代码行数:14,代码来源:Connector.cs

示例12: Login

        public static IEnumerator Login()
        {
            if (Credentials.user_email != "" && Credentials.user_password != "")
            {
                LWInterface.NewNotification("Attempting to log in..", LWInterface.Notification.LWNotificationType.Message);
                WWWForm requestForm = new WWWForm();
                requestForm.AddField("email", Credentials.user_email);
                requestForm.AddField("password", Credentials.user_password);
                WWW request = new WWW(Domain, requestForm);

                yield return request;

                string requestText = request.text;

                if (requestText != "NLI")
                {
                    string[] creds;
                    char delim = '&';
                    creds = requestText.Split(delim);

                    Credentials.SetUser(creds[0], creds[1]);
                    isLoggedIn = true;

                    if (LoginMode == LWLoginMode.automatic_connection)
                    {
                        LWInterface.NewNotification(Credentials.user_name + " logged in. Connecting...", LWInterface.Notification.LWNotificationType.Success);
                        LWNetwork.Client.InitializeClient();
                    }
                    else
                    {
                        LWInterface.NewNotification(Credentials.user_name + " logged in.", LWInterface.Notification.LWNotificationType.Success);
                    }
                    //Automatically connect after logging in if configured to do so
                }
                else
                {
                    LWInterface.NewNotification("Incorrect login.", LWInterface.Notification.LWNotificationType.Error);
                    //Do something else if the login is invalid
                }
                //If the page does not return "NLI", the login is valid
                //Otherwise, the incorrect credentials were provided

                Credentials.ClearLogin();
                //Clear the user's login credentials, regardless of their validity
            }
            else
            {
                Debug.LogError("Login credentials not set, use LWLogin.Credentials.SetLogin()");
            }
        }
开发者ID:gradylorenzo,项目名称:LiveWorld,代码行数:50,代码来源:LWLogin.cs

示例13: SendBuildEvent

        public static void SendBuildEvent()
        {
            Settings settings = Settings.Instance;

            Utils.Log ("Sending build information");
            #if UNITY_CLOUD_BUILD
            settings.Organization.ApiKey = "ffb52e2b5f4b59267466b65b90a7bf0e7f9c6190";
            #else
            if (string.IsNullOrEmpty(settings.Organization.ApiKey)) {
                Utils.Error ("API key not found");
                return;
            }
            #endif

            var bundleId = PlayerSettings.bundleIdentifier;
            WWWForm form = new WWWForm();
            form.AddField("app_name", bundleId);
            form.AddField("app_identifier", bundleId);
            form.AddField("base_identifier", bundleId);
            form.AddField("platform_id", "android");

            var headers = new Dictionary<string, string> ();
            headers.Add("X-CRASHLYTICS-DEVELOPER-TOKEN", "771b48927ee581a1f2ba1bf60629f8eb34a5b63f");
            headers.Add("X-CRASHLYTICS-API-KEY", settings.Organization.ApiKey);
            headers.Add("X-CRASHLYTICS-API-CLIENT-ID", "io.fabric.tools.unity");
            headers.Add("X-CRASHLYTICS-API-CLIENT-DISPLAY-VERSION", "1.0.0");

            string url = "https://api.crashlytics.com/spi/v1/platforms/android/apps/" + bundleId + "/built";
            byte[] rawData = form.data;
            WWW www = new WWW(url, rawData, headers);

            var timeout = false;
            var t0 = DateTime.UtcNow;
            while (!www.isDone) {
                var t1 = DateTime.UtcNow;
                var delta = (int)(t1-t0).TotalSeconds;
                if (delta > 5) {
                    timeout = true;
                    break;
                }
            };

            if (timeout) {
                Utils.Warn ("Timed out waiting for build event response. If this is a production build, you may want to build again to ensure it has been properly sent.");
            } else if (string.IsNullOrEmpty(www.error)) {
                Utils.Log ("Build information sent");
            } else {
                Utils.Error ("Could not send build event. Error: " + www.error);
            }
        }
开发者ID:Barnaff,项目名称:Chromania,代码行数:50,代码来源:FabricBuildEventAndroid.cs

示例14: Character

		public void Character()
		{
			_log = "Loading...";
			
			WWWForm form = new WWWForm();
			
			form.AddField("u900151974_login", username);
			form.AddField("u900151974_pass", pswd);
			
			connect = new WWW(getCharacter, form);
			
			StartCoroutine(WaitForRequestCharacter(connect));
			
		}
开发者ID:moskra,项目名称:Orions,代码行数:14,代码来源:Connection.cs

示例15: SaveFloat

		private IEnumerator SaveFloat(string serverAddress,string key, float value){
			WWWForm newForm = new WWWForm ();
			newForm.AddField ("key", key);
			newForm.AddField ("value", value.ToString());
			
			WWW w = new WWW (serverAddress + "/saveFloat.php", newForm);
			
			while (!w.isDone) {
				yield return new WaitForEndOfFrame();
			}
			
			if (w.error != null) {
				Debug.LogError (w.error);
			}
		}
开发者ID:AlexGam,项目名称:TowerIsland,代码行数:15,代码来源:SetFloat.cs


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