Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
Customer request to support QRCode in my Project instead of Standered Barcode (like:- code93)
how to auto read QRCode using Barcode Scanner without using form Controls such as textbox?

What I have tried:

in this time I use this function to collect the barcode from Barcode Scanner Input
but it seem that it don't work with QRcode ( it work fine with code93 , code39,...)
Hint: the item code stored in the Database as VARCHAR(200)
C#
private string BarCode = "";
DateTime _lastKeystroke = new DateTime(0);

private void evtKeyUpEvent(object sender, KeyEventArgs e)

{
    if (Keys.NumPad0 <= e.KeyCode && e.KeyCode <= Keys.NumPad9)
    {
        BuildBarCode((e.KeyCode - Keys.NumPad0).ToString());
    }
    else if (Keys.D0 <= e.KeyCode && e.KeyCode <= Keys.D9)
    {

        BuildBarCode((e.KeyCode - Keys.D0).ToString());
    }
    if (65 <= e.KeyValue && e.KeyValue <= 90)
    {
        BuildBarCode((e.KeyCode).ToString());
    }
    else if (Keys.ShiftKey == e.KeyCode)
    {
    }
    else if (Keys.OemPeriod == e.KeyCode)
    {
        BuildBarCode(".");
    }
    else if (Keys.Multiply == e.KeyCode)
    {
        BuildBarCode("*");
    }
    else if (Keys.Add == e.KeyCode)
    {
        BuildBarCode("+");
    }
    else if (Keys.Separator == e.KeyCode)
    {
        BuildBarCode("|");
    }
    else if (Keys.Subtract == e.KeyCode)
    {
        BuildBarCode("-");
    }
    else if (Keys.Divide == e.KeyCode)
    {
        BuildBarCode("/");
    }
    else if (Keys.Separator == e.KeyCode)
    {
        BuildBarCode(",");
    }
    else if (Keys.Separator == e.KeyCode)
    {
        BuildBarCode(",");
    }

    else if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return)
    {
        updateUIBarCode(BarCode);
    }
}
private void BuildBarCode(string value)
{
    BarCode = string.Concat(BarCode, value);
}

public void updateUIBarCode(string i)
{
    AddNewRowWithCode(i);
}


I searched in Google but all of the result explain how to read the Image and convert it to text. can you guide me how to imporve my fuction to support QRcode or how to achieve my goal ?
Posted
Updated 20-Jan-21 15:08pm
v6
Comments
Richard MacCutchan 20-Jan-21 9:17am    
You need to check the scanner documentation to see what data, and what format, it returns.
Golden Basim 20-Jan-21 9:25am    
I already requested the documentation and model from the customer. but in general are my fuction can read correctly QRcode? or also this depend on the scanner?
Richard MacCutchan 20-Jan-21 9:44am    
The question is impossible to answer as it is specific to the actual scanner that will be used.
Golden Basim 23-Jan-21 2:04am    
i found the problem, the function dosn't add the space to the code. i think this will solve the problem
 else if (Keys.Space == e.KeyCode)
            {
                BuildBarCode(" ");
            }




can you suggest please how to support all others symbols?
Richard MacCutchan 23-Jan-21 4:00am    
Sorry, no; because I have no idea how the scanner works or what information it returns to your application.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900