using UnityEngine; using System.Collections; using System; using System.Net; using System.Net.Mail; using System.Net.Security; using System.Security.Cryptography.X509Certificates; using UnityEngine.UI; public class Mail : MonoBehaviour { public GameObject Text_02,send; public Vector2 creatPosition;
public void Update() { if (GameObject.Find("QQMileAdress").GetComponent<Text>().text.Length <= 14) { send.GetComponent<Button>().interactable = false; } else { send.GetComponent<Button>().interactable = true; } }
public void SendEmail() { MailMessage mail = new MailMessage();
mail.From = new MailAddress("xxx@qq.com");//发件人 mail.To.Add(GameObject.Find("QQMileAdress").GetComponent<Text>().text);//收件人 mail.Subject = "Test Mail";//标题 mail.Body = "This is for Me";//内容 mail.Attachments.Add(new Attachment(Application.dataPath + "/" + "QR.png"));//附件
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using ZXing; using ZXing.QrCode; using System.IO;
public class QR_Code : MonoBehaviour { public string QrCodeStr; public List<string> Mylist; public GameObject Text, createPosition; //在屏幕上显示二维码 public RawImage image; public Text Items; //存放二维码 Texture2D encoded; int Nmuber = 0;
void Start() { encoded = new Texture2D(256, 256); }
void Update() { if (Input.GetKeyDown(KeyCode.Return)) { Sign(); } }
/// 定义方法生成二维码 private static Color32[] Encode(string textForEncoding, int width, int height) { var writer = new BarcodeWriter { Format = BarcodeFormat.QR_CODE, Options = new QrCodeEncodingOptions { Height = height, Width = width } }; return writer.Write(textForEncoding); }