nxtlib/src/Protocol.cs
/// <summary>
/// [Native] Open a file for reading.  When finished reading, the handle MUST be closed with 
/// the Close() command.  If an error occurs, this handle will be closed automatically.
/// </summary>
/// <param name="filename">The name of the file to read, as a string.
///   The extension must be included.  The possible file extensions are: 
/// Program (.rxe), Graphic (.ric), Sound (.rso), Datalog (.rdt), and Text (.txt).</param>
/// <returns>The reply as struct NXTOpenReadReply.</returns>
[Native] Open a file for reading.  When finished reading, the handle MUST be closed with
the Close() command.  If an error occurs, this handle will be closed automatically.
[ Native ] Open a file for reading . When finished reading the handle MUST be closed with the Close () command . If an error occurs this handle will be closed automatically .
public NXTOpenReadReply OpenRead(string filename)
        {
            ValidateFilename(filename);
            byte[] request = new byte[22];
            request[0] = 0x01;
            request[1] = (byte)MessageCommand.OpenRead;
            Encoding.ASCII.GetBytes(filename).CopyTo(request, 2);
            byte[] reply = CompleteRequest(request);
            NXTOpenReadReply result = new NXTOpenReadReply();
            result.handle = reply[3];
            result.fileSize = GetUInt32(reply, 4);
            return result;
        }
public NXTOpenReadReply OpenRead ( string filename ) { ValidateFilename ( filename ) ; byte [ ] request = new byte [ 22 ] ; request [ 0 ] = 0x01 ; request [ 1 ] = ( byte ) MessageCommand . OpenRead ; Encoding . ASCII . GetBytes ( filename ) . CopyTo ( request , 2 ) ; byte [ ] reply = CompleteRequest ( request ) ; NXTOpenReadReply result = new NXTOpenReadReply ( ) ; result . handle = reply [ 3 ] ; result . fileSize = GetUInt32 ( reply , 4 ) ; return result ; }
[Native] Open a file for reading.
[ Native ] Open a file for reading .
The reply as struct NXTOpenReadReply.
The reply as struct NXTOpenReadReply .
filename
string
The name of the file to read, as a string.
The extension must be included.  The possible file extensions are:
Program (.rxe), Graphic (.ric), Sound (.rso), Datalog (.rdt), and Text (.txt).
The name of the file to read as a string . The extension must be included . The possible file extensions are : Program ( . rxe ) Graphic ( . ric ) Sound ( . rso ) Datalog ( . rdt ) and Text ( . txt ) .