vbscript VB.net中提示模块的模板

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vbscript VB.net中提示模块的模板相关的知识,希望对你有一定的参考价值。

Module MainPrompt
    Public Const PromptSymbol As String = "TLA > "
    Public Const ApplicationTitle As String = "Short name of the application"

    Sub Main()
        Dim Statement As String
        Dim BrokenDownStatement As String()
        Dim Command As String
        Dim Args As String()
        Dim Result As String

        Console.ForegroundColor = ConsoleColor.Cyan
        Console.Title = ApplicationTitle & " command line console"

        Console.WriteLine("Welcome to " & ApplicationTitle & "console frontend")
        Console.WriteLine("This package is version " & GetType(Project.BaseClass).Assembly.GetName().Version.ToString)
        Console.WriteLine()
        Console.Write(PromptSymbol)

        Do While True
            Statement = Console.ReadLine()
            BrokenDownStatement = Statement.Split(" ")
            ReDim Args(BrokenDownStatement.Length - 1)
            Command = BrokenDownStatement(0)

            For i = 1 To BrokenDownStatement.Length - 1
                Args(i - 1) = BrokenDownStatement(i)
            Next

            Select Case Command.ToLower
                Case "example"
                    Result = DoSomething(Example)
                Case "exit", "quit"
                    Exit Do
                Case "ver"
                    Result = "This package is version " & GetType(Project.BaseClass).Assembly.GetName().Version.ToString
                Case Else
                    Result = "Command not acknowldged: -" & Command & "-"
            End Select
            Console.WriteLine(" " & Result)
            Console.Write(PromptSymbol)
        Loop

        Console.WriteLine("I am exiting, time is " & DateTime.Now.ToString("u"))
        Console.WriteLine("Goodbye")
        Environment.Exit(0)
    End Sub
End Module

以上是关于vbscript VB.net中提示模块的模板的主要内容,如果未能解决你的问题,请参考以下文章

vbscript [.net] VB.NET笔记

vbscript [VB.NET]新事物#test

vbscript Varios Razor VB.NET

vbscript VB.net正常运行时间报告

vbscript 这向您展示了在Dynamo VB.Net中拆分字符串的最佳方法

vbscript 从vb.net后面的代码调用javascript函数