Click here to Skip to main content
15,913,944 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: UPLOAD ERROR - in real Web Server Pin
hifiger200425-Sep-07 21:11
hifiger200425-Sep-07 21:11 
Questionbrowser compatibility problem Pin
nicetohaveyou24-Sep-07 22:56
nicetohaveyou24-Sep-07 22:56 
QuestionProblem in passing message betwin client server. Pin
Tarun Dudhatra24-Sep-07 19:28
Tarun Dudhatra24-Sep-07 19:28 
Questionreading web site content Pin
dhatchu24-Sep-07 18:34
dhatchu24-Sep-07 18:34 
AnswerRe: reading web site content Pin
Christian Graus24-Sep-07 18:38
protectorChristian Graus24-Sep-07 18:38 
QuestionWeb parts User control Events Pin
zol_tech24-Sep-07 5:53
zol_tech24-Sep-07 5:53 
AnswerRe: Web parts User control Events Pin
Jpuckett25-Sep-07 17:38
Jpuckett25-Sep-07 17:38 
QuestionConverting a PHP HexToBin function to C# [modified] Pin
#realJSOP24-Sep-07 5:20
professional#realJSOP24-Sep-07 5:20 
I'm converting some code from PHP to C# (.Net 2.0). Can someone that knows PHP verify that the C# code I wrote does the same thing as the original PHP code? The actual line I'm concerned about is inside the for loop.

private string HexToBin(string data) 
{
/*
    // original php function
    $len = strlen($data);
    $newdata='';
    for($i=0;$i<$len;$i+=2) 
    {
        $newdata .=  pack("C",hexdec(substr($data,$i,2)));
    }
    return $newdata;
*/
    int length = data.Length;
    string newData = "";
    for (int i = 0; i < data.Length; i += 2) 
    {
        string value = data.Substring(i, 2);
        newData += Int32.Parse(value, NumberStyles.HexNumber).ToString();
    }
    return newData;
}




Maybe that line in the for loop needs to be this?

newData += string.Format("{0}", Int32.Parse(value, NumberStyles.Integer));



If I completely mangled it up, don't be shy about telling me, but give me the correct code if you feel up to it.






-- modified at 11:50 Monday 24th September, 2007


"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


AnswerRe: Converting a PHP HexToBin function to C# Pin
Guffa24-Sep-07 7:34
Guffa24-Sep-07 7:34 
GeneralRe: Converting a PHP HexToBin function to C# Pin
#realJSOP24-Sep-07 9:55
professional#realJSOP24-Sep-07 9:55 
AnswerRe: Converting a PHP HexToBin function to C# Pin
Guffa24-Sep-07 10:29
Guffa24-Sep-07 10:29 
GeneralRe: Converting a PHP HexToBin function to C# Pin
#realJSOP25-Sep-07 0:14
professional#realJSOP25-Sep-07 0:14 
AnswerRe: Converting a PHP HexToBin function to C# Pin
Guffa25-Sep-07 0:25
Guffa25-Sep-07 0:25 
AnswerRe: Converting a PHP HexToBin function to C# [SOLVED] Pin
#realJSOP25-Sep-07 3:37
professional#realJSOP25-Sep-07 3:37 
AnswerRe: Converting a PHP HexToBin function to C# [SOLVED] Pin
Guffa25-Sep-07 19:49
Guffa25-Sep-07 19:49 
QuestionAOL API for Calendar data? Pin
vbmithai23-Sep-07 20:00
vbmithai23-Sep-07 20:00 
QuestionCCAvenue intregation Pin
Abhishek0323-Sep-07 19:56
Abhishek0323-Sep-07 19:56 
QuestionHow the FILEUPLOAD to prevent from posting back? Pin
hifiger200423-Sep-07 7:23
hifiger200423-Sep-07 7:23 
AnswerRe: How the FILEUPLOAD to prevent from posting back? Pin
Guffa23-Sep-07 8:57
Guffa23-Sep-07 8:57 
GeneralRe: How the FILEUPLOAD to prevent from posting back? Pin
hifiger200423-Sep-07 12:16
hifiger200423-Sep-07 12:16 
GeneralRe: How the FILEUPLOAD to prevent from posting back? Pin
Christian Graus23-Sep-07 12:42
protectorChristian Graus23-Sep-07 12:42 
AnswerRe: How the FILEUPLOAD to prevent from posting back? Pin
hifiger200423-Sep-07 17:20
hifiger200423-Sep-07 17:20 
GeneralRe: How the FILEUPLOAD to prevent from posting back? Pin
Christian Graus23-Sep-07 19:17
protectorChristian Graus23-Sep-07 19:17 
GeneralRe: How the FILEUPLOAD to prevent from posting back? Pin
Malcolm Smart27-Sep-07 2:15
Malcolm Smart27-Sep-07 2:15 
QuestionURGENT: Please Help - ASP Error Pin
Azi Qaiser23-Sep-07 2:10
Azi Qaiser23-Sep-07 2:10 

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.