inputwrapper.vb

来自「用ADO.Net实现通用数据库编程源码.rar」· VB 代码 · 共 38 行

VB
38
字号
' InputWrapper.vb
'
' Class to wrap simple stream input
' Datatype supported:
'      Integer
'      double
'      decimal
'      String

Imports System

Public Class InputWrapper
    Public Function getInt(ByVal prompt As String) As Integer
        Console.Write(prompt)
        Dim buf As String
        buf = Console.ReadLine()
        Return Convert.ToInt32(buf)
    End Function
    Public Function getDouble(ByVal prompt As String) As Double
        Console.Write(prompt)
        Dim buf As String
        buf = Console.ReadLine()
        Return Convert.ToDouble(buf)
    End Function
    Public Function getDecimal(ByVal prompt As String) As Decimal
        Console.Write(prompt)
        Dim buf As String
        buf = Console.ReadLine()
        Return Convert.ToDecimal(buf)
    End Function
    Public Function getString(ByVal prompt As String) As String
        Console.Write(prompt)
        Dim buf As String
        buf = Console.ReadLine()
        Return buf
    End Function
End Class

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?