Click here to Skip to main content
15,908,841 members
Home / Discussions / C#
   

C#

 
GeneralGraphics in the Command Line Pin
timbobsteve20-Jul-05 15:13
timbobsteve20-Jul-05 15:13 
GeneralRe: Graphics in the Command Line Pin
Dave Kreskowiak20-Jul-05 15:48
mveDave Kreskowiak20-Jul-05 15:48 
GeneralRe: Graphics in the Command Line Pin
timbobsteve20-Jul-05 16:27
timbobsteve20-Jul-05 16:27 
GeneralImplementing MIDL interface in .NET. Pin
Akth20-Jul-05 14:51
Akth20-Jul-05 14:51 
GeneralRe: Implementing MIDL interface in .NET. Pin
Christian Graus20-Jul-05 14:57
protectorChristian Graus20-Jul-05 14:57 
GeneralRe: Implementing MIDL interface in .NET. Pin
Akth20-Jul-05 15:08
Akth20-Jul-05 15:08 
GeneralRe: Implementing MIDL interface in .NET. Pin
Christian Graus20-Jul-05 15:48
protectorChristian Graus20-Jul-05 15:48 
QuestionVB6 (eek!) to VB.net to C#????? Pin
WetRivrRat20-Jul-05 13:48
WetRivrRat20-Jul-05 13:48 
Hey guys,
got a friend who is still stuck on vb6(says he loves it WTF | :WTF: ) anyhow he passed me some code that i need to convert, i got it to .net with the VS.net03 tool. But now i need it to C#, i'm not a vb programmer so i'm struggling to understand why it isn't working right. i've tried using a few different code converters but they all fail!Mad | :mad:

I've enclosed the code... any help is auesome.... oh, and anything quick is even better. My deadline got bumped from next week to tomorrow am. (which is why i had my friend "help" me.)

k,
one more thing.. it WILL run in vb.net once i upgraded it from vb6, but i can not get it to compile in C#!

'UPGRADE_NOTE: Text was upgraded to Text_Renamed. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1061"'
	Private Function Crypt(ByVal Text_Renamed As String, ByVal Key As String) As String
		Dim KeyLen, i, KeyPtr As Integer
		Dim KeyChr, TextChr As Short
		KeyLen = Len(Key)
		For i = 1 To Len(Text_Renamed)
			TextChr = Asc(Mid(Text_Renamed, i, 1))
			KeyChr = Asc(Mid(Key, KeyPtr + 1, 1))
			Mid(Text_Renamed, i, 1) = Chr(TextChr Xor KeyChr)
			KeyPtr = ((KeyPtr + 1) Mod KeyLen)
		Next i
		Crypt = Text_Renamed
	End Function
	
	Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
		txtText.Text = CStr(Now)
		txtPath.Text = VB6.GetPath & "\DateTest.bin"
	End Sub

just in case it helps here is the vb6 code...

Private Function Crypt(ByVal Text As String, ByVal Key As String) As String
    Dim i As Long, KeyLen As Long, KeyPtr As Long, KeyChr As Integer, TextChr As Integer
    KeyLen = Len(Key)
    For i = 1 To Len(Text)
        TextChr = Asc(Mid(Text, i, 1))
        KeyChr = Asc(Mid(Key, KeyPtr + 1, 1))
        Mid(Text, i, 1) = Chr(TextChr Xor KeyChr)
        KeyPtr = ((KeyPtr + 1) Mod KeyLen)
    Next i
    Crypt = Text
End Function

Private Sub Form_Load()
    txtText.Text = Now
    txtPath.Text = App.Path & "\DateTest.bin"
End Sub

Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."


Why is common sense such an un-common comodity?
AnswerRe: VB6 (eek!) to VB.net to C#????? Pin
Christian Graus20-Jul-05 14:27
protectorChristian Graus20-Jul-05 14:27 
GeneralRe: VB6 (eek!) to VB.net to C#????? Pin
WetRivrRat20-Jul-05 14:39
WetRivrRat20-Jul-05 14:39 
GeneralRe: VB6 (eek!) to VB.net to C#????? Pin
Christian Graus20-Jul-05 14:41
protectorChristian Graus20-Jul-05 14:41 
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 
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 

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.