using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using System.Runtime.InteropServices; using System; using System.Net; using System.Text; public class Login : MonoBehaviour { //联网使用功能 public string yanZhengFanHui = "lianwang"; private string url = "http://yuyuesheji.com/yz/yanzheng.html"; void Start() { XinyanZheng(); } void XinyanZheng() { WebClient myWebClient = new WebClient(); myWebClient.Credentials = CredentialCache.DefaultCredentials; byte[] pageData = myWebClient.DownloadData(url); string pageHtml = Encoding.UTF8.GetString(pageData); yanZhengFanHui = pageHtml; } public void LogoinOK() { if (yanZhengFanHui == "ok")//激活码有效 { } else//激活码无效 { } } } |