Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27203

How to convert VBScript to VB.Net

$
0
0
I am trying to convert a vbscript to VB.net. This is where I am currently, can someone help me convert this to vb.net?
Code:

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Const FOF_CREATEPROGRESSDLG = &H0&
        Dim fName
        Dim objShell, objFolder As Object
        Dim TargetFolder As String
        Dim d As Date = Date.Today
        d = d.AddDays(-5)
        fName = Microsoft.VisualBasic.Right("00" & Month(d), 2) & "." & Microsoft.VisualBasic.Right("00" & Day(d), 2) & "." & Microsoft.VisualBasic.Right(Year(d), 2) & "_"
        TargetFolder = "N:\Daily Data\Production"
        objShell = CreateObject("Shell.Application")
        objFolder = objShell.NameSpace(TargetFolder)
        objFolder.MoveHere("Q:\Archive\\" & fName & "*", FOF_CREATEPROGRESSDLG)
    End Sub
End Class

The compile errors I get are:
Day is a type and cannot be used in an expression

Viewing all articles
Browse latest Browse all 27203

Trending Articles



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