Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

Code migration to VB to C#

$
0
0
I've already done it in VB6 which was perfectly working fine but i've to work it in c#
for locking access database
Sub lockDb(bPath AsString)
    OnErrorGoTo Ermsg
    Dim iFreeFile   AsIntegerDim lLoop       AsIntegerDim sString     AsString 
    iFreeFile = FreeFile() 'Get free file #
    Open bPath For Binary As #iFreeFile 'Open specified file for binary I/O.

    sString = "DVUnion Windows Database"'Default header data.
For lLoop = 7To19'loop through and update byte positions 9 through 15.
        Put #iFreeFile, lLoop, VBA.Mid$(sString, lLoop - 4, 1)
    Next lLoop
'    If cmdunlock.Enabled = False Then cmdunlock.Enabled = True
''    cmdlock.Enabled = False
Close #iFreeFile
 
for unlock access database
Sub UnlockDb(bPath AsString)
    OnErrorGoTo Ermsg
    Dim iFreeFile   AsIntegerDim lLoop       AsIntegerDim sString     AsString
    iFreeFile = FreeFile() 'Get free file #
    Open bPath For Binary As #iFreeFile 'Open specified file for binary I/O.

    sString = "Standard Jet DB"'Default header data.
For lLoop = 7To19'loop through and update byte positions 9 through 15.
        Put #iFreeFile, lLoop, VBA.Mid$(sString, lLoop - 4, 1)
    Next lLoop
    Close #iFreeFile
 
How to do it in c#
www.facebook.com/raazak47

Viewing all articles
Browse latest Browse all 3938

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>