Click here to Skip to main content
15,903,012 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to use ConfigurationManager to modifying "applicationSettings" section of App.config using .NET (C#) Visual Studio2005 Pin
Thomas_Mathews1-Feb-09 23:03
Thomas_Mathews1-Feb-09 23:03 
QuestionXor the hex values Pin
M. J. Jaya Chitra30-Jan-09 1:51
M. J. Jaya Chitra30-Jan-09 1:51 
AnswerRe: Xor the hex values Pin
musefan30-Jan-09 2:05
musefan30-Jan-09 2:05 
GeneralRe: Xor the hex values Pin
M. J. Jaya Chitra30-Jan-09 2:11
M. J. Jaya Chitra30-Jan-09 2:11 
GeneralRe: Xor the hex values Pin
musefan30-Jan-09 2:20
musefan30-Jan-09 2:20 
GeneralRe: Xor the hex values Pin
musefan30-Jan-09 2:19
musefan30-Jan-09 2:19 
GeneralRe: Xor the hex values Pin
M. J. Jaya Chitra30-Jan-09 18:07
M. J. Jaya Chitra30-Jan-09 18:07 
GeneralRe: Xor the hex values Pin
cevikcaner3-Sep-09 20:40
cevikcaner3-Sep-09 20:40 
I changed binary2Hex and Hex2Binary parts to make a bit more efficient Smile | :)
I am using the code above at the moment, it is trusted to be worked.



private string HexToBinary(string hexString)
{
    string binaryval = String.Empty;
    for (int i = 0; i < hexString.Length; i = i + 2)
    {
       binaryval += Convert.ToString(Convert.ToInt32(hexString.Substring(i, 2), 16), 2).PadLeft(8, '0');
    }

    return binaryval;
}

private string BinaryToHex(string binString)
{
    string hexval = String.Empty;

    for (int i = 0; i < binString.Length; i = i + 8)
    {
       hexval += Convert.ToString(Convert.ToInt32(binString.Substring(i, 8), 2), 16).PadLeft(2, '0');
    }
    return hexval;
}

private string XORStrings(string s1, string s2)
{
    string bin1 = HexToBinary(s1);
    string bin2 = HexToBinary(s2);

    string result = String.Empty;
    for (int i = 0; i < bin1.Length; i++)
    {
         if (bin1[i] == bin2[i])//either both 0 or both 1
             result += "0";
         else //both are different i.e. 1 and 0 or 0 and 1
             result += "1";
    }
    return BinaryToHex(result);

}

AnswerRe: Xor the hex values Pin
harold aptroot30-Jan-09 2:47
harold aptroot30-Jan-09 2:47 
QuestionExecuting an exe with C# code Pin
MatthysDT30-Jan-09 1:36
MatthysDT30-Jan-09 1:36 
AnswerRe: Executing an exe with C# code Pin
musefan30-Jan-09 1:38
musefan30-Jan-09 1:38 
GeneralRe: Executing an exe with C# code Pin
MatthysDT30-Jan-09 1:48
MatthysDT30-Jan-09 1:48 
GeneralRe: Executing an exe with C# code Pin
musefan30-Jan-09 1:58
musefan30-Jan-09 1:58 
GeneralRe: Executing an exe with C# code Pin
MatthysDT30-Jan-09 2:06
MatthysDT30-Jan-09 2:06 
GeneralRe: Executing an exe with C# code Pin
Ankit Rajpoot30-Jan-09 2:18
Ankit Rajpoot30-Jan-09 2:18 
GeneralRe: Executing an exe with C# code Pin
MatthysDT30-Jan-09 2:30
MatthysDT30-Jan-09 2:30 
GeneralRe: Executing an exe with C# code Pin
musefan30-Jan-09 2:25
musefan30-Jan-09 2:25 
GeneralRe: Executing an exe with C# code Pin
MatthysDT30-Jan-09 2:33
MatthysDT30-Jan-09 2:33 
QuestionHow secure Pin
ziwez030-Jan-09 0:42
ziwez030-Jan-09 0:42 
AnswerRe: How secure Pin
musefan30-Jan-09 1:04
musefan30-Jan-09 1:04 
QuestionPDF creation library in C sharp Pin
Sudhir Mangla30-Jan-09 0:25
professionalSudhir Mangla30-Jan-09 0:25 
AnswerRe: PDF creation library in C sharp Pin
VoidMainVoid30-Jan-09 0:30
VoidMainVoid30-Jan-09 0:30 
AnswerRe: PDF creation library in C sharp Pin
sw_tech12330-Jan-09 1:02
sw_tech12330-Jan-09 1:02 
GeneralRe: PDF creation library in C sharp Pin
Sudhir Mangla30-Jan-09 1:10
professionalSudhir Mangla30-Jan-09 1:10 
AnswerRe: PDF creation library in C sharp Pin
Sudhir Mangla30-Jan-09 20:02
professionalSudhir Mangla30-Jan-09 20:02 

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.