Kevin
asked on
Convert VB.Net Code to C#
Good Afternoon,
I need to rewrite an application from VB.Net to C#. I don't know any C# but guess I will learn along the way. i am using a converter (http://converter.telerik.com/) to convert my module but the converter doesn't appear to convert everything.
I've created a class for my functions (since modules are not used in C#) and am having trouble converting the below to C#, can someone help me rewrite it?
Also what syntax would I use to call these functions from within my application?
Any help would be most appreciated.
Kind Regards,
N
I need to rewrite an application from VB.Net to C#. I don't know any C# but guess I will learn along the way. i am using a converter (http://converter.telerik.com/) to convert my module but the converter doesn't appear to convert everything.
I've created a class for my functions (since modules are not used in C#) and am having trouble converting the below to C#, can someone help me rewrite it?
Imports Microsoft.Win32
Module modGlobals
'Global Registry
Public gRegKeyName As String = "HKEY_CURRENT_USER\Software\AFA\TOOLEX"
Public Function gConnString() As String
'Global Access Database
Dim DBPath As String
DBPath = My.Computer.Registry.GetValue(gRegKeyName, "DBPath", "")
gConnString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & DBPath & ";Persist Security Info=False;"
Return gConnString
End Function
Public Function gCSVExport() As String
'Global CSV Export Path
Dim ExportPath As String
ExportPath = My.Computer.Registry.GetValue(gRegKeyName, "ExportPath", "")
Return ExportPath
End Function
End Module
Also what syntax would I use to call these functions from within my application?
Any help would be most appreciated.
Kind Regards,
N
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER