Questions on things I couldn't seem to find by searching google or the forums.

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
So I suppose Ill start with what exactly Im trying to do to give the questions some context. Im trying to make a program in visual basic 2010 as a console application that will allow me to navigate to and open my previous programs that Ive finished in tutorials.
Now for the questions:
  • My first question would be how can make it so that it doesnt matter which line you type text into (in the application itself) the program will be able to open the corresponding program? As of right now you have to be on the right line in the application and type in the right phrase in order to open the program you want to open.
  • My second question is how would I make it so that it gives me multiple choices of what number or phrase you type in? As an example, say I have the program tell me that if I enter "4" or "Id like to open my first program ever.", then I would have to enter either of those in order to open the correct program.
I apologize in advance if Im not following specific rules, I believe this is the first time Ive even ever posted a question in a forum.
Imports System.IO
Module Module1
Sub Main()
The immediately below are going to be what defines how the program looks.
Console.Title = "Gabes Program"
Console.BackgroundColor = ConsoleColor.Cyan
Console.ForegroundColor = ConsoleColor.DarkGreen
The immediately below is the first thing I see.
Console.WriteLine("How ya dern Gabe")
The immediately below are If statements.
If Console.ReadLine() = "Pretty Good" Then
Console.WriteLine("Vary Nice.")
Console.WriteLine("What would you like to do?")
If Console.ReadLine() = "Calculate statistics easily." Then
Process.Start("C:UsersGreenDocumentsVisual Studio 2010ProjectsStatisticsApplicationStatisticsApplicationbinDebugStatisticsApplication.exe")
If Console.ReadLine() = "View the Maze program." Then
Process.Start("C:UsersGreenDesktopGabesdtopfoldaProgramsProgrammingYour_First_ProgramsMaze.exe")
If Console.ReadLine() = "View the Math Quiz program." Then
Process.Start("C:UsersGreenDesktopGabesdtopfoldaProgramsProgrammingYour_First_ProgramsMath Quiz1.exe")
If Console.ReadLine() = "View the Picture Viewer program." Then
Process.Start("C:UsersGreenDesktopGabesdtopfoldaProgramsProgrammingYour_First_ProgramsPictureViewer.exe")
If Console.ReadLine() = "View the Matching Game program." Then
Process.Start("C:UsersGreenDesktopGabesdtopfoldaProgramsProgrammingYour_First_ProgramsMatchingGame.exe")
End If
End If
End If
End If
End If
End If
End
The immediately below is what makes the program stay open.
Console.ReadLine()
End Sub
End Module

View the full article
 
Back
Top