Click here to Skip to main content
15,917,795 members
Home / Discussions / C#
   

C#

 
GeneralRe: VB6 (eek!) to VB.net to C#????? Pin
WetRivrRat20-Jul-05 14:52
WetRivrRat20-Jul-05 14:52 
GeneralRe: VB6 (eek!) to VB.net to C#????? Pin
Christian Graus20-Jul-05 14:56
protectorChristian Graus20-Jul-05 14:56 
GeneralRe: VB6 (eek!) to VB.net to C#????? Pin
WetRivrRat20-Jul-05 15:15
WetRivrRat20-Jul-05 15:15 
GeneralRe: VB6 (eek!) to VB.net to C#????? Pin
tatchung20-Jul-05 15:42
tatchung20-Jul-05 15:42 
GeneralRe: VB6 (eek!) to VB.net to C#????? Pin
Christian Graus20-Jul-05 15:49
protectorChristian Graus20-Jul-05 15:49 
GeneralRe: VB6 (eek!) to VB.net to C#????? Pin
Christian Graus20-Jul-05 15:53
protectorChristian Graus20-Jul-05 15:53 
GeneralRe: VB6 (eek!) to VB.net to C#????? Pin
WetRivrRat20-Jul-05 17:25
WetRivrRat20-Jul-05 17:25 
GeneralRe: VB6 (eek!) to VB.net to C#????? Pin
Christian Graus20-Jul-05 17:38
protectorChristian Graus20-Jul-05 17:38 
wetrivrrat wrote:
have never had to implement any crypto in my apps, and this being the first i'm struggling to grasp the functions as i was dealing with the teacher

OK, well, the first step is to remember that it's all still C#, the bits we're talking about now are pretty straightforward. You create an array of bytes and populate it. the example is showing you how to do that broadly, but copy and paste won't work, nor will you learn anything that way.

wetrivrrat wrote:
i'll post the code result from the converter David Anton suggested.

I already tried it, it's a disaster.

Do you really want to use code that you don't understand ?

Here it is, anyhow. This works, but I still think you're going about things the wrong way to be copying and pasting code you don't understand. I am just taking pity in this case because you're under the gun.

private string Crypt(string Text_Renamed, string Key)
{
    int KeyLen = Key.Length;
    string NewText = "";
    int KeyPtr = 0;
    for (int i = 0; (i < Text_Renamed.Length); i++)
    {
        short TextChr = Convert.ToInt16(Text_Renamed[i]);
        short KeyChr = Convert.ToInt16(Key[KeyPtr]);
        NewText += Convert.ToChar(TextChr ^ KeyChr);
        KeyPtr = (KeyPtr+1) % KeyLen;
    }

    return NewText;
}


Christian Graus - Microsoft MVP - C++
GeneralRe: VB6 (eek!) to VB.net to C#????? Pin
WetRivrRat20-Jul-05 17:42
WetRivrRat20-Jul-05 17:42 
GeneralRe: VB6 (eek!) to VB.net to C#????? Pin
Christian Graus20-Jul-05 17:47
protectorChristian Graus20-Jul-05 17:47 
GeneralRe: VB6 (eek!) to VB.net to C#????? Pin
WetRivrRat20-Jul-05 18:01
WetRivrRat20-Jul-05 18:01 
GeneralRe: VB6 (eek!) to VB.net to C#????? Pin
Christian Graus20-Jul-05 18:09
protectorChristian Graus20-Jul-05 18:09 
AnswerRe: VB6 (eek!) to VB.net to C#????? Pin
Dave Doknjas20-Jul-05 16:13
Dave Doknjas20-Jul-05 16:13 
GeneralRe: VB6 (eek!) to VB.net to C#????? Pin
Christian Graus20-Jul-05 17:41
protectorChristian Graus20-Jul-05 17:41 
GeneralRe: VB6 (eek!) to VB.net to C#????? Pin
Dave Doknjas20-Jul-05 19:24
Dave Doknjas20-Jul-05 19:24 
GeneralRe: VB6 (eek!) to VB.net to C#????? Pin
Christian Graus21-Jul-05 13:20
protectorChristian Graus21-Jul-05 13:20 
GeneralPrinting window form Pin
quangmogulasia20-Jul-05 12:57
quangmogulasia20-Jul-05 12:57 
GeneralFocus Pin
nc3b20-Jul-05 12:39
nc3b20-Jul-05 12:39 
GeneralRe: Focus Pin
Mark Greenwood20-Jul-05 18:07
Mark Greenwood20-Jul-05 18:07 
GeneralRe: Focus Pin
nc3b21-Jul-05 0:01
nc3b21-Jul-05 0:01 
GeneralRe: Focus Pin
nc3b21-Jul-05 1:15
nc3b21-Jul-05 1:15 
GeneralRe: Focus Pin
[Marc]21-Jul-05 16:10
[Marc]21-Jul-05 16:10 
GeneralRe: Focus Pin
nc3b21-Jul-05 21:21
nc3b21-Jul-05 21:21 
GeneralRe: Focus Pin
[Marc]22-Jul-05 9:29
[Marc]22-Jul-05 9:29 
QuestionHow can i find the DataRow number in DataRowCollection Pin
m.rastgar20-Jul-05 12:30
m.rastgar20-Jul-05 12:30 

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.