电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

与注册登录服务器交互原理及code

与注册登录服务器交互原理及code_第1页
1/4
与注册登录服务器交互原理及code_第2页
2/4
与注册登录服务器交互原理及code_第3页
3/4
Unity 与注册登录服务器交互原理及 code Posted on 2025 年 07 月 07 日 by U3d / Unity3D 基础教程/被围观 70 次 主要用到了 unity 内置的 WWW 类和 WWWForm 类,运用WWWForm.AddField(String fieldName, String value)方法通过 post 的表单提交方式把表单参数传递给服务器端的逻辑业务层。客户端的 demo 效果图:Unity 与注册登录服务器交互原理及 codeimei 是手机的唯一识别 id,用 imei 表示可能不恰当.客户端代码:using UnityEngine; using System.Collections; using System.Text.RegularExpressions; public class Client : MonoBehaviour { WWW www; WWWForm form; string url; string username_label = “username:”; string username_input = “”; string password_label = “password:”; string password_input = “”; string password_label = “password:”; string password_input = “”; string email_label = “email:”; string email_input = “”; string callback_label = “result:”; string callback_label = “”; void OnStart() { } void OnGUI() { GUI.Label(new Rect(, , , ), username_label); username_input = GUI.TextField(new Rect(, , , ), username_input); GUI.Label(new Rect(, , , ), password_label); password_input = GUI.TextField(new Rect(, , , ), password_input); GUI.Label(new Rect(, , , ), password_label); password_input = GUI.TextField(new Rect(, , , ), password_input); GUI.Label(new Rect(, , , ), email_label); email_input = GUI.TextField(new Rect(, , , ), email_input); GUI.Label(new Rect(, , , ), callback_label); callback_label = GUI.TextField(new Rect(, , , ), callback_label); if (GUI.Button(new Rect(, , , ), “Login”)) { form = new WWWForm(); form.AddField(“name”, username_input); form.AddField(“password”, password_input); string url = “http://...:/ddt/UserLogin.jsp”; www = new WWW(url, form); StartCoroutine(WaitForRequestUserNameLogin(www)); } if (GUI.Button(new Rect(, , , ), “Register”)) { ...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

与注册登录服务器交互原理及code

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部