I have been asked by my colleagues to write a program that allows us to enter a job number and it will take us to the proper folder within our database (SolidWorks EPDM). The structure of the folders is as follows: C:\Litania EPDM\Orders\XXXX\XX\number with the first set of Xs representing the year and the second set the month. Example job number being 112113-444121-1X, so that 11 would be the month, 12 the day, 13 the year (2013), the middle six are the unique job number and the 1X is just a suffix which changed to 2X and so on if there are multiple orders under the same number.
What I need to accomplish is setting up variables (strings) that can hold the year with a "20" in front of it, the month, the number and the suffix then I need to combine those into a folder path. Here is what I have:
Public Class ProjectLookup
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim day As String = CStr(DateText.Text)
Dim string1 As String = Microsoft.VisualBasic.Right(day, 4)
Dim month As String = Microsoft.VisualBasic.Left(string1, 2)
Dim year As String = "20" + Microsoft.VisualBasic.Right(string1, 2)
Dim num As String = CStr(NumberText.Text)
Dim suff As String = CStr(SuffixText.Text)
Process.Start("explorer.exe", "C:\Litania EPDM\Orders\" + year + " \ " + month + " \ " + num + suff)
End Sub
End Class
Any help would be greatly appreciated. Currently it runs and opens windows explorer, but does not go to the intended path. Thank you.
CStr()s are pointless -.Textis already a string. You're also using very old syntax - it's VB6-esque. instead ofMicrosoft.VisualBasic.Left(string1, 2)dostring1.Left(2)Process.Start(StringVariableWithPathInIt)