Exemple #1
0
 public Form1()
 {
     InitializeComponent();
     setting();
     ini = new Ini(@Filepath);
 }
Exemple #2
0
        ///// <summary>
        ///// 读取二维码
        ///// 读取失败,返回空字符串
        ///// </summary>
        ///// <param name="filename">指定二维码图片位置</param>
        //public static string read_img(string imageUri)
        //{
        //    BarcodeReader reader = new BarcodeReader();
        //    Bitmap map = getbitmap(imageUri);
        //    Result result = reader.Decode(map);
        //    return result == null ? "" : result.Text;
        //}

        /// <summary>
        /// 二维码解码
        /// </summary>
        /// <param name="filePath">图片路径</param>
        /// <returns></returns>
        //public  string read_img(string imageUri)
        //{
        //    Bitmap myBitmap = getbitmap(imageUri);
        //    QRCodeDecoder decoder = new QRCodeDecoder();
        //    string decodedString = decoder.decode(new QRCodeBitmapImage(myBitmap));
        //    return decodedString;
        //}



        /// <summary>
        /// 获取网络二维码对象
        /// </summary>
        /// <param name="imageUri">网络二维码地址</param>
        /// <returns></returns>
        //public Bitmap getbitmap(string imageUri)
        //{
        //    Bitmap img = null;
        //    HttpWebRequest req;
        //    HttpWebResponse res = null;
        //    try
        //    {
        //        System.Uri httpUrl = new System.Uri(imageUri);
        //        req = (HttpWebRequest)(WebRequest.Create(httpUrl));
        //        req.Method = "GET";
        //        res = (HttpWebResponse)(req.GetResponse());
        //        img = new Bitmap(res.GetResponseStream());//获取图片流
        //                                                  // img.Save("H:\\1.png");
        //    }

        //    catch (Exception ex)
        //    {
        //        string aa = ex.Message;
        //    }
        //    finally
        //    {
        //        res.Close();
        //    }
        //    return img;
        //}

        /// <summary>
        /// 写入公告内容
        /// </summary>
        /// <param name="str"></param>
        public void Add_setting(string str)
        {
            Ini ini = new Ini(@".\\setting.ini");

            ini.Writue("Message", "Say", str);
        }
Exemple #3
0
        private void Add_setting(string str)
        {
            Ini ini = new Ini(@Filepath);

            ini.Writue("Message", "note", path);
        }