Seek() public method

Sets the position within the current stream.
An I/O error occurs. The stream does not support seeking, such as if the stream is constructed from a pipe or console output. Methods were called after the stream was closed.
public Seek ( long offset, SeekOrigin origin ) : long
offset long A byte offset relative to the parameter.
origin SeekOrigin A value of type indicating the reference point used to obtain the new position.
return long
コード例 #1
0
ファイル: SftpFileStreamTest.cs プロジェクト: pecegit/sshnet
 public void SeekTest()
 {
     SftpSession session = null; // TODO: Initialize to an appropriate value
     string path = string.Empty; // TODO: Initialize to an appropriate value
     FileMode mode = new FileMode(); // TODO: Initialize to an appropriate value
     SftpFileStream target = new SftpFileStream(session, path, mode); // TODO: Initialize to an appropriate value
     long offset = 0; // TODO: Initialize to an appropriate value
     SeekOrigin origin = new SeekOrigin(); // TODO: Initialize to an appropriate value
     long expected = 0; // TODO: Initialize to an appropriate value
     long actual;
     actual = target.Seek(offset, origin);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }