zoukankan      html  css  js  c++  java
  • C# 读取Text文本,写入Text文本

    //读取
    private void showMess() { this.dataGridViewX2.Rows.Clear(); //将车辆信息一行行添加到datagreatview 里面 StreamReader sr = File.OpenText("C:\Users\Administrator\Desktop\CarMessages.txt"); string line; int i = 0; List<string> list = new List<string>(); while ((line = sr.ReadLine()) != null) { list.Add(line); i++; } dataGridViewX2.Rows.Add(i); int qq = list.Count; for (int a = 0; a < qq; a++) { dataGridViewX2.Rows[a].Cells[0].Value = list[a].ToString(); } //列宽自适应 dataGridViewX2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; dataGridViewX2.ReadOnly = true; }

    写入Text

     try
                    {
                        MultiFormatWriter mutiWriter = new com.google.zxing.MultiFormatWriter();
                        ByteMatrix bm = mutiWriter.encode( table.Rows[0]["CarID"].ToString() , com.google.zxing.BarcodeFormat.QR_CODE, 363, 150);
                        Bitmap img = bm.ToBitmap();
    
    
    
                        string filename = "C:\Users\Administrator\Desktop\Car_Messages\" + table.Rows[0]["MenName"].ToString()  + table.Rows[0]["CarID"].ToString() + ".jpg";
                        img.Save(filename, System.Drawing.Imaging.ImageFormat.Jpeg);
    
                    }
                    catch (Exception ee)
                    { MessageBox.Show(ee.Message); }
                }
  • 相关阅读:
    FPGA-中值滤波
    FPGA-中值滤波
    FPGA-shift_ram代码
    FPGA实现-shift_ram_3x3矩阵实现
    图像处理-中值滤波
    python-str
    ignore-certificate-errors(chrome)
    selenium-python-Cookie跳过登录验证码
    Angular2
    Angular2
  • 原文地址:https://www.cnblogs.com/hanke123/p/5541260.html
Copyright © 2011-2022 走看看