Example #1
0
 private string getDeviceID()
 {
     if (deviceID == "")
     {
         deviceID = StringUtil.Base64Encode(DeviceID.Get());
     }
     Debug.Log("deviceId:" + deviceID);
     return(deviceID);
 }
Example #2
0
//	[DllImport("__Internal")]
//	private static extern string GetIphoneADID();

    public static string getMacAdd()
    {
//		#if UNITY_ANDROID
//			deviceId = SystemInfo.deviceUniqueIdentifier;
//		#elif UNITY_IPHONE
//			deviceId = "IOS-" + GetIphoneADID();
//		#endif

//		if (Application.platform == RuntimePlatform.IPhonePlayer) {
//			//deviceId = Device.advertisingIdentifier;
//			if (deviceId == "") {
//				NetworkInterface[] nis = NetworkInterface.GetAllNetworkInterfaces();
//				string mac = "";
//				foreach (NetworkInterface ni in nis) {
//					mac = ni.GetPhysicalAddress ().ToString ();
//					if (mac != "") {
//						deviceId = NetUtil.Base64Encode(mac);
//						break;
//					}
//					//			mac = mac + "-" + ni.GetPhysicalAddress ().ToString ();
//					//			Debug.Log ("Name = " + ni.Name);
//					//			Debug.Log ("Des = " + ni.Description);
//					//			Debug.Log ("Type = " + ni.NetworkInterfaceType.ToString() );
//					//			Debug.Log ("Mac地址 = " + ni.GetPhysicalAddress().ToString() );
//					//			Debug.Log ("------------------------------------------------");
//				}
//			}
//		}
//		else {
//			deviceId = SystemInfo.deviceUniqueIdentifier;
//		}

        deviceId = DeviceID.Get();
        Debug.Log("deviceId:" + deviceId);
        //return NetUtil.Base64Encode(deviceId);
        return(StringUtil.Base64Encode(deviceId));
    }
Example #3
0
 /// <summary>
 /// Base64加密
 /// </summary>
 /// <param name="s"></param>
 /// <returns></returns>
 public static string Base64Encode(this string s)
 {
     return(StringUtil.Base64Encode(s));
 }
Example #4
0
 /// <summary>
 /// Base64加密
 /// </summary>
 /// <param name="s"></param>
 /// <param name="encoding"></param>
 /// <returns></returns>
 public static string Base64Encode(this string s, Encoding encoding)
 {
     return(StringUtil.Base64Encode(s, encoding));
 }
 private void btnToBase64_Click(object sender, EventArgs e)
 {
     SC.S2 = StringUtil.Base64Encode(SC.S1, SC.GetEncoding());
     this.Close();
 }