www.pudn.com > 用ADO.Net实现通用数据库编程源码.rar > InputWrapper.vb


' 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