Click here to Skip to main content
15,913,123 members
Home / Discussions / C#
   

C#

 
QuestionC# Enterprise Projects - Practical examples Pin
mosselman4-Nov-08 5:02
mosselman4-Nov-08 5:02 
AnswerRe: C# Enterprise Projects - Practical examples Pin
Ennis Ray Lynch, Jr.4-Nov-08 5:45
Ennis Ray Lynch, Jr.4-Nov-08 5:45 
AnswerRe: C# Enterprise Projects - Practical examples Pin
Meer Osman Ali4-Nov-08 5:50
Meer Osman Ali4-Nov-08 5:50 
QuestionReg:email domain Verification Pin
swethasri4-Nov-08 4:07
swethasri4-Nov-08 4:07 
AnswerRe: Reg:email domain Verification Pin
Ennis Ray Lynch, Jr.4-Nov-08 4:20
Ennis Ray Lynch, Jr.4-Nov-08 4:20 
GeneralRe: Reg:email domain Verification Pin
swethasri4-Nov-08 5:17
swethasri4-Nov-08 5:17 
AnswerRe: Reg:email domain Verification Pin
Guffa4-Nov-08 12:36
Guffa4-Nov-08 12:36 
QuestionString implementation in .NET Framework Pin
J4amieC4-Nov-08 3:38
J4amieC4-Nov-08 3:38 
I have some legacy VB6 code which im converting over to C#, and it seems that strings were implemented very differently in old VB than in the Framework. I get vastly different results from the ported code than I do from an app written in VB and I was wondering if anyone could put their finger on the reason why?

here is the old VB code (pstrResponse is the input to the method):

For i = 1 To Len(pstrResponse)

      j = Asc(Mid(pstrResponse, i, 1))

      If j > 127 Then

         j = j - 128

         Mid(pstrResponse, i, 1) = Chr(j)

      End If

   Next i


Here is my ported C# (input is the input):

char[] charArray = input.ToCharArray();
int bit;
for (int i = 0; i < charArray.Length; i++)
{
    bit = (int)charArray[i];
    if (bit > 127)
    {
        bit -= 128;
        charArray[i] = (char)bit;
    }
}
return new string(charArray);


As you can see, simple code & easy to port but very different results. Any ideas people?
AnswerRe: String implementation in .NET Framework Pin
Ennis Ray Lynch, Jr.4-Nov-08 4:06
Ennis Ray Lynch, Jr.4-Nov-08 4:06 
GeneralRe: String implementation in .NET Framework Pin
J4amieC4-Nov-08 4:12
J4amieC4-Nov-08 4:12 
GeneralRe: String implementation in .NET Framework Pin
Ennis Ray Lynch, Jr.4-Nov-08 4:18
Ennis Ray Lynch, Jr.4-Nov-08 4:18 
GeneralRe: String implementation in .NET Framework Pin
J4amieC4-Nov-08 5:25
J4amieC4-Nov-08 5:25 
GeneralRe: String implementation in .NET Framework Pin
DaveyM694-Nov-08 4:32
professionalDaveyM694-Nov-08 4:32 
GeneralRe: String implementation in .NET Framework Pin
J4amieC4-Nov-08 5:26
J4amieC4-Nov-08 5:26 
GeneralRe: String implementation in .NET Framework Pin
DaveyM694-Nov-08 5:32
professionalDaveyM694-Nov-08 5:32 
AnswerRe: String implementation in .NET Framework Pin
PIEBALDconsult4-Nov-08 4:34
mvePIEBALDconsult4-Nov-08 4:34 
GeneralRe: String implementation in .NET Framework Pin
J4amieC4-Nov-08 5:28
J4amieC4-Nov-08 5:28 
QuestionHow to create my own button [usercontrol? or what?] Pin
Matjaz-xyz4-Nov-08 2:34
Matjaz-xyz4-Nov-08 2:34 
AnswerRe: How to create my own button [usercontrol? or what?] Pin
cyber-drugs4-Nov-08 3:34
cyber-drugs4-Nov-08 3:34 
GeneralRe: How to create my own button [usercontrol? or what?] Pin
Matjaz-xyz4-Nov-08 3:41
Matjaz-xyz4-Nov-08 3:41 
GeneralRe: How to create my own button [usercontrol? or what?] Pin
cyber-drugs4-Nov-08 3:54
cyber-drugs4-Nov-08 3:54 
AnswerRe: How to create my own button [usercontrol? or what?] [modified] Pin
DaveyM694-Nov-08 3:47
professionalDaveyM694-Nov-08 3:47 
QuestionHow do display a form in a seperate thread Pin
EliottA4-Nov-08 2:27
EliottA4-Nov-08 2:27 
AnswerRe: How do display a form in a seperate thread Pin
dybs4-Nov-08 2:41
dybs4-Nov-08 2:41 
AnswerRe: How do display a form in a seperate thread Pin
Dave Kreskowiak4-Nov-08 3:35
mveDave Kreskowiak4-Nov-08 3:35 

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.