• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 290
  • Last Modified:

how to modify this vbscript code to vb.net code

Hello,

how to modify this vbscript code to vb.net code so I can build a GUI interface and buttons to do the same functions of these 2 codes.

I know it's easy but I don't have much experience in that.

Thanks so much in advance
batch5.vbs
batch6.vbs
0
Jason Yousef, MS
Asked:
Jason Yousef, MS
  • 2
1 Solution
 
Jason Yousef, MSSr. BI DeveloperAuthor Commented:
Can anybody please guide me if there's a tool of something to do that convert, I know there's a tool to convert ASP to ASP.net but couldn't find anything for VBScript.

Thanks
0
 
killasktoCommented:
I dont know if there is a tool, but here are your vbscript files in VB .NET 2005
'BATCH5 and BATCH6'

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim strInput As String
        Dim strOutput As String

        strInput = "stix.txt"
        strOutput = "stix" & Now.ToString("yyyyMMdd-HHmmss") & ".txt"

        Dim objInput As New IO.StreamReader(strInput)
        Dim objOutput As New IO.StreamWriter(strOutput)
        Dim arrText() As String
        arrText = Split(Replace(objInput.ReadToEnd, Chr(34), ""), vbCrLf)
        objInput.Close()
        Dim i As Integer
        For i = 0 To UBound(arrText) - 1 Step 2
            objOutput.WriteLine(arrText(i) & arrText(i + 1))
        Next
        objOutput.Close()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim strInput As String
        Dim strOutput As String

        strInput = "stix2.txt"
        strOutput = "stix-2-" & Now.ToString("yyyyMMdd-HHmmss") & ".txt"

        Dim objInput As New IO.StreamReader(strInput)
        Dim objOutput As New IO.StreamWriter(strOutput)
        Dim arrText() As String
        arrText = Split(Replace(objInput.ReadToEnd, Chr(34), ""), vbCrLf)
        objInput.Close()
        Dim i As Integer
        For i = 0 To UBound(arrText) - 4 Step 5
            objOutput.WriteLine(arrText(i) & arrText(i + 1) & arrText(i + 2) & arrText(i + 3) & arrText(i + 4))
        Next
        objOutput.Close()
    End Sub
End Class

Open in new window

0
 
Jason Yousef, MSSr. BI DeveloperAuthor Commented:
Thanks! you're the best.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now