|
|
|
Click here to copy the following block | Private Declare Function GetStdHandle Lib "kernel32" (ByVal nStdHandle As Long) _ As Long Private Declare Function ReadFile Lib "kernel32" (ByVal hFile As Long, _ lpBuffer As Any, ByVal nNumberOfBytesToRead As Long, _ lpNumberOfBytesRead As Long, lpOverlapped As Any) As Long
Private Const STD_INPUT_HANDLE = -10&
Function ReadFromStdInput(Optional ByVal NumBytes As Long = -1) As String Dim hStdIn As Long Dim ret As Long Dim buffer As String Dim bytesRead As Long hStdIn = GetStdHandle(STD_INPUT_HANDLE) buffer = Space$(1024) Do ret = ReadFile(hStdIn, ByVal buffer, Len(buffer), bytesRead, ByVal 0&) If ret = 0 Then Err.Raise 1001, , "Unable to read from standard input" End If ReadFromStdInput = ReadFromStdInput & Left$(buffer, bytesRead) Loop Until bytesRead < Len(buffer) End Function |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|