Click here to Skip to main content
15,897,187 members
Home / Discussions / C#
   

C#

 
AnswerRe: Distinguish between Keyboard and basic Barcode Scanner Pin
Brad Wick16-Oct-08 6:21
Brad Wick16-Oct-08 6:21 
GeneralRe: Distinguish between Keyboard and basic Barcode Scanner Pin
J-Cod3r16-Oct-08 20:24
J-Cod3r16-Oct-08 20:24 
GeneralRe: Distinguish between Keyboard and basic Barcode Scanner Pin
Brad Wick17-Oct-08 4:12
Brad Wick17-Oct-08 4:12 
AnswerRe: Distinguish between Keyboard and basic Barcode Scanner Pin
Dirso16-Oct-08 6:58
Dirso16-Oct-08 6:58 
AnswerRe: Distinguish between Keyboard and basic Barcode Scanner Pin
Dave Kreskowiak16-Oct-08 7:09
mveDave Kreskowiak16-Oct-08 7:09 
GeneralRe: Distinguish between Keyboard and basic Barcode Scanner Pin
Brad Wick17-Oct-08 12:49
Brad Wick17-Oct-08 12:49 
GeneralRe: Distinguish between Keyboard and basic Barcode Scanner Pin
Dave Kreskowiak17-Oct-08 16:35
mveDave Kreskowiak17-Oct-08 16:35 
QuestionSpeed Up Try Catch Pin
fly90416-Oct-08 4:36
fly90416-Oct-08 4:36 
Hi,
I'm new to c# and was wondering if there is a quicker way of doing to following code without using the try and catch method as it is slow.

int result;
try
{
    int str1_num = int.Parse(str1.Replace(",", ""));
    int str2_num = int.Parse(str2.Replace(",", ""));
    if (lvi1.ListView.Sorting == SortOrder.Descending)
    {
        if (str1_num < str2_num)
            result = 1;
        else
            result = 0;
    }
    else
    {
        if (str1_num > str2_num)
            result = 1;
        else
            result = 0;
    }

}
catch
{
    if (lvi1.ListView.Sorting == SortOrder.Descending)
        result = String.Compare(str1, str2);
    else
        result = String.Compare(str2, str1);
}


Cheers
Fly

hmmm pie

AnswerRe: Speed Up Try Catch Pin
SeMartens16-Oct-08 4:49
SeMartens16-Oct-08 4:49 
AnswerRe: Speed Up Try Catch Pin
Paul Conrad16-Oct-08 9:24
professionalPaul Conrad16-Oct-08 9:24 
QuestionMSI Setup - custom action rollback Pin
Mogyi16-Oct-08 3:24
Mogyi16-Oct-08 3:24 
AnswerRe: MSI Setup - custom action rollback Pin
HemJoshi16-Oct-08 3:47
HemJoshi16-Oct-08 3:47 
GeneralRe: MSI Setup - custom action rollback Pin
Mogyi16-Oct-08 4:10
Mogyi16-Oct-08 4:10 
QuestionWhat is best way? Pin
Majid_grok16-Oct-08 2:45
Majid_grok16-Oct-08 2:45 
RantRe: What is best way? Pin
Nagy Vilmos16-Oct-08 3:06
professionalNagy Vilmos16-Oct-08 3:06 
Questiongot problem with sequence of event execution Pin
Krazy Programmer16-Oct-08 2:37
Krazy Programmer16-Oct-08 2:37 
AnswerRe: got problem with sequence of event execution Pin
Guffa16-Oct-08 3:17
Guffa16-Oct-08 3:17 
GeneralRe: got problem with sequence of event execution Pin
Krazy Programmer16-Oct-08 19:44
Krazy Programmer16-Oct-08 19:44 
GeneralRe: got problem with sequence of event execution Pin
Guffa17-Oct-08 13:38
Guffa17-Oct-08 13:38 
GeneralRe: got problem with sequence of event execution Pin
nelsonpaixao16-Oct-08 12:36
nelsonpaixao16-Oct-08 12:36 
GeneralRe: got problem with sequence of event execution Pin
Krazy Programmer16-Oct-08 19:44
Krazy Programmer16-Oct-08 19:44 
QuestionThreads and WinForms Pin
Programm3r16-Oct-08 1:45
Programm3r16-Oct-08 1:45 
AnswerRe: Threads and WinForms Pin
Alan N16-Oct-08 1:59
Alan N16-Oct-08 1:59 
GeneralRe: Threads and WinForms Pin
Programm3r16-Oct-08 2:03
Programm3r16-Oct-08 2:03 
QuestionRe: Threads and WinForms Pin
Programm3r16-Oct-08 2:13
Programm3r16-Oct-08 2:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.