I work in windows from c# vs 2015
i read data from scanner bar code reader directly to my windows
without using text box box but i face problem
i need to increase number of character when receiving to 200 character
so that how to increase that please ?
code below working success but it read only 13 character
i need to increase it to 200 character or less so that how ?
- public partial class Form1 : Form
- {
- DateTime _lastKeystroke = new DateTime(0);
- List<char> _barcode = new List<char>(10);
- public Form1()
- {
- InitializeComponent();
- }
-
-
-
- private void Form1_KeyPress(object sender, KeyPressEventArgs e)
- {
- TimeSpan elapsed = (DateTime.Now - _lastKeystroke);
- if (elapsed.TotalMilliseconds > 100)
- _barcode.Clear();
-
- _barcode.Add(e.KeyChar);
- _lastKeystroke = DateTime.Now;
-
- if (e.KeyChar == 13 && _barcode.Count > 0)
- {
- string msg = new String(_barcode.ToArray());
-
- label1.Text = msg;
- _barcode.Clear();
- }
- }
- }
- }
so that code above can read but 13 character only
i need to increase it to 200 character or less .
bar code scanner is working as USB keyboard as HID keyboard read qr code