473,692 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need Help Converting VB6 to VB.NET

Hello All,
I have tried multiple online tools to convert an VB6 (bas) file to
VB.NET file and no luck. I was hoping that someone could help me covert
this. I am new to the .NET world and still learning all help would be
greatly apperciated.
Attribute VB_Name = "Module1"
Option Explicit

Dim pass$
Dim Strg$

Function decrypt(ByVal H$) As String

Dim i As Integer, J$

pass$ = "THEFELDGRO UP"

'H$ = the buffered encrypted data

H$ = Mid$(H$, 3, Val(Left$(H$, 2)))

' debuffer it

Strg$ = ""
For i = 1 To Len(H$) Step 2
J$ = Mid$(H$, i, 2)
Strg$ = Strg$ + Chr$(Val("&H" + J$))
Next

'Strg$ now contains the encrypted string, which you can now
'decrypt.

Call Crypt(pass$, Strg$)

'strg$ now is decrypted

decrypt = Strg$

End Function

Function Crypt(pass$, Strg$)
Dim a, b
Dim i As Integer

a = 1
For i = 1 To Len(Strg$)
b = Asc(Mid$(pass$, a, 1)): a = a + 1: If a Len(pass$) Then a =
1
Mid$(Strg$, i, 1) = Chr$(Asc(Mid$(S trg$, i, 1)) Xor b)
Next

End Function

Oct 9 '06 #1
16 5440
Noticed the name of this NG? Please post to the
microsoft.publi c.dotnet.langua ges.vb NG.
Willy.
<ma**********@g mail.comwrote in message
news:11******** **************@ i3g2000cwc.goog legroups.com...
| Hello All,
| I have tried multiple online tools to convert an VB6 (bas) file to
| VB.NET file and no luck. I was hoping that someone could help me covert
| this. I am new to the .NET world and still learning all help would be
| greatly apperciated.
|
|
| Attribute VB_Name = "Module1"
| Option Explicit
|
| Dim pass$
| Dim Strg$
|
|
|
| Function decrypt(ByVal H$) As String
|
| Dim i As Integer, J$
|
| pass$ = "THEFELDGRO UP"
|
| 'H$ = the buffered encrypted data
|
| H$ = Mid$(H$, 3, Val(Left$(H$, 2)))
|
| ' debuffer it
|
| Strg$ = ""
| For i = 1 To Len(H$) Step 2
| J$ = Mid$(H$, i, 2)
| Strg$ = Strg$ + Chr$(Val("&H" + J$))
| Next
|
| 'Strg$ now contains the encrypted string, which you can now
| 'decrypt.
|
| Call Crypt(pass$, Strg$)
|
| 'strg$ now is decrypted
|
| decrypt = Strg$
|
| End Function
|
| Function Crypt(pass$, Strg$)
| Dim a, b
| Dim i As Integer
|
| a = 1
| For i = 1 To Len(Strg$)
| b = Asc(Mid$(pass$, a, 1)): a = a + 1: If a Len(pass$) Then a =
| 1
| Mid$(Strg$, i, 1) = Chr$(Asc(Mid$(S trg$, i, 1)) Xor b)
| Next
|
| End Function
|
Oct 9 '06 #2
<ma**********@g mail.comwrote in message
news:11******** **************@ i3g2000cwc.goog legroups.com...
I have tried multiple online tools to convert an VB6 (bas) file to
VB.NET file and no luck. I was hoping that someone could help me covert
this. I am new to the .NET world
And to the world of newsgroups too, by the looks of it...

Is there any particular reason that you posted a question regarding
converting VB6 to VB.NET to a C# newsgroup...?
Oct 9 '06 #3
Yes,
Actually I will be converting this to C#. Thought converting to VB.NET
might be easier. If anyone could help me convert this to C#, even
better :).

Thanks
Mark Rae wrote:
<ma**********@g mail.comwrote in message
news:11******** **************@ i3g2000cwc.goog legroups.com...
I have tried multiple online tools to convert an VB6 (bas) file to
VB.NET file and no luck. I was hoping that someone could help me covert
this. I am new to the .NET world

And to the world of newsgroups too, by the looks of it...

Is there any particular reason that you posted a question regarding
converting VB6 to VB.NET to a C# newsgroup...?
Oct 9 '06 #4
<ma**********@g mail.comwrote in message
news:11******** **************@ e3g2000cwe.goog legroups.com...
Yes,
Actually I will be converting this to C#.
Ah... what you need to do is to enable telepathy mode when posting on
newsgroups - if you're using Outlook or Outlook Express, it's under Tools,
Options...

That way, everybody will just instinctively understand what you really
mean...
Oct 9 '06 #5
Use the VB.NET upgrade wizard (with Visual Studio) to convert this.
Hopefully, it can handle those nasty ancient VB1 type specifiers...
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
Instant Python: VB to Python converter
"ma**********@g mail.com" wrote:
Hello All,
I have tried multiple online tools to convert an VB6 (bas) file to
VB.NET file and no luck. I was hoping that someone could help me covert
this. I am new to the .NET world and still learning all help would be
greatly apperciated.
Attribute VB_Name = "Module1"
Option Explicit

Dim pass$
Dim Strg$

Function decrypt(ByVal H$) As String

Dim i As Integer, J$

pass$ = "THEFELDGRO UP"

'H$ = the buffered encrypted data

H$ = Mid$(H$, 3, Val(Left$(H$, 2)))

' debuffer it

Strg$ = ""
For i = 1 To Len(H$) Step 2
J$ = Mid$(H$, i, 2)
Strg$ = Strg$ + Chr$(Val("&H" + J$))
Next

'Strg$ now contains the encrypted string, which you can now
'decrypt.

Call Crypt(pass$, Strg$)

'strg$ now is decrypted

decrypt = Strg$

End Function

Function Crypt(pass$, Strg$)
Dim a, b
Dim i As Integer

a = 1
For i = 1 To Len(Strg$)
b = Asc(Mid$(pass$, a, 1)): a = a + 1: If a Len(pass$) Then a =
1
Mid$(Strg$, i, 1) = Chr$(Asc(Mid$(S trg$, i, 1)) Xor b)
Next

End Function

Oct 9 '06 #6
Thanks for the info David but I have already tried that and it made it
look even worse.
Any Help?
David Anton wrote:
Use the VB.NET upgrade wizard (with Visual Studio) to convert this.
Hopefully, it can handle those nasty ancient VB1 type specifiers...
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
Instant Python: VB to Python converter
"ma**********@g mail.com" wrote:
Hello All,
I have tried multiple online tools to convert an VB6 (bas) file to
VB.NET file and no luck. I was hoping that someone could help me covert
this. I am new to the .NET world and still learning all help would be
greatly apperciated.
Attribute VB_Name = "Module1"
Option Explicit

Dim pass$
Dim Strg$

Function decrypt(ByVal H$) As String

Dim i As Integer, J$

pass$ = "THEFELDGRO UP"

'H$ = the buffered encrypted data

H$ = Mid$(H$, 3, Val(Left$(H$, 2)))

' debuffer it

Strg$ = ""
For i = 1 To Len(H$) Step 2
J$ = Mid$(H$, i, 2)
Strg$ = Strg$ + Chr$(Val("&H" + J$))
Next

'Strg$ now contains the encrypted string, which you can now
'decrypt.

Call Crypt(pass$, Strg$)

'strg$ now is decrypted

decrypt = Strg$

End Function

Function Crypt(pass$, Strg$)
Dim a, b
Dim i As Integer

a = 1
For i = 1 To Len(Strg$)
b = Asc(Mid$(pass$, a, 1)): a = a + 1: If a Len(pass$) Then a =
1
Mid$(Strg$, i, 1) = Chr$(Asc(Mid$(S trg$, i, 1)) Xor b)
Next

End Function
Oct 10 '06 #7
Mannit,

I assume that this is a troll message to let people say that C# is better.

In my idea you don't know much from VB otherwise you would not have included
this in your message.

'H$ = the buffered encrypted data

Cor
Oct 10 '06 #8
Yeah, I perfer C# over VB.NET anytime. I did not even noticed that I
had that in the statement.

So, has anyone converted this so far?

:( -If I had the ability to cry on this forum, I would make this
face cry.


Cor Ligthert [MVP] wrote:
Mannit,

I assume that this is a troll message to let people say that C# is better.

In my idea you don't know much from VB otherwise you would not have included
this in your message.

'H$ = the buffered encrypted data

Cor
Oct 10 '06 #9
On Oct 9, 3:01 pm, manmit.wa...@gm ail.com wrote:
Attribute VB_Name = "Module1"
Option Explicit

Dim pass$
Dim Strg$
These are just strings, so declare them normally in C#:

string pass;
string Strg;
>
Function decrypt(ByVal H$) As String
This is a method that takes a string and returns a string:

public string decrypt(string h)
Dim i As Integer, J$
An integer and a string:

int i;
string J;
>
pass$ = "THEFELDGRO UP"
This is just string assignment.
>
'H$ = the buffered encrypted data
Same here
H$ = Mid$(H$, 3, Val(Left$(H$, 2)))
Here, the Mid$ statement is taking a substring of a string so in .Net
it would be the string.Substrin g method. The Left$ method would also
be replaced by the Substring method.
' debuffer it

Strg$ = ""
String assignment again.
For i = 1 To Len(H$) Step 2
For loop:

for (int i = 1; i <= H.Length; i += 2)
J$ = Mid$(H$, i, 2)
Strg$ = Strg$ + Chr$(Val("&H" + J$))
Next
More Substring activity, along with some string concatenation.

The remaining method is just more of the same. It should be a fairly
straight forward conversion. If you have a specifc problem, you can
post those questions for help here.

Good Luck.

Oct 10 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3191
by: Newbee Adam | last post by:
I have been reading in help how I need to use decimal becuase currency does not exist like I used in vb6. I had a difficult time on google and msdn finding how or if I can take the value of text box as decimal or do I just have to make another decimal variable .. So I took a guess hoping CDec would come up blue if I type it in with no squigglies on the line. But is this actually converting it to decimal. Next if so, I do not like the...
2
1438
by: Megat | last post by:
I'm trying to create a conversion program, that convert a simple proprietry programming language to an international standard languange, using Visual C++. Need some help from those who has experience or anyone who has any idea in creating such program. Really appreciate your help. Thank you
8
5734
by: prabha | last post by:
Hello Everybody, I have to conert the word doc to multiple html files,according to the templates in the word doc. I had converted the word to xml.Also through Exsl ,had finished the multiple output html files. The problem is while reading through the worddoc paragraph,the special characters are not identified. So in the xml file,it's just storing that as "?".So I couldn't able to retrive the characters in my ouput html files.
4
2955
by: Jake Jessup | last post by:
A client wants me to do a conversion from Access 2.0 (yeah, I know, unreal). The problem is, she doesn't have the install disks and I haven't had a copy of 2.0 in years. If some kind should could kindly point me to a place where I might get a copy, I would be grateful. I'm willing to do a trade for it.
5
2515
by: Robert | last post by:
I have a series of web applications (configured as separate applications) on a server. There is a main application at the root and then several virtual directories that are independant applications. I am testing an upgrade of all of the sites and have converted the main root site...although not necessarily fixed any issues. I move on instead and converted one of the virtual roots that is a seperate
27
1965
by: sam_cit | last post by:
Hi, I needed help in converting a character to the correspoding hexadecimal values, like the following example, ASCII value : ABC Hex Code Value : %41%42%43... whats the logic of conversion...
2
2216
Mhel
by: Mhel | last post by:
Hi everyone! I need some help in Converting Infix to postfix.I need a program that would do it. Please, I really need help.
10
3237
by: Hank Stalica | last post by:
I'm having this weird problem where my code does the following conversion from string to float: 27000000.0 -27000000.00 2973999.99 -29740000.00 2989999.13 -2989999.25 The number on the left is the string I get after tokenizing a bigger string. The number on the right is the number I get after the conversion.
7
5334
helpwithcode
by: helpwithcode | last post by:
Hi people, I am just learning java.I have been creating a project which involves JDBC Connectivity.I find that the statements, String string_dob=text_dob.getText(); //Converting string to date System.out.println(string_dob); s.Info_DOB=Date.valueOf(string_dob); runs perfectly fine in the method insert() and throws up an illegal Exception in the method UPDATE.This is the error I get when I pass a date "1979-05-02"
0
8611
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8970
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8811
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7641
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6462
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5823
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4331
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4564
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2989
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.