Exemplo n.º 1
0
        /// <summary>
        /// Send Write Request. Create the WRQ packet, send it to the server. INIT --> WRQ_SENT.
        /// </summary>
        /// <param name="remoteFile">The remote file.</param>
        /// <param name="localFile">The local file.</param>
        /// <param name="tftpMode">The TFTP mode.</param>
        /// <param name="sndBuffer">The returned sending buffer.</param>
        public static void sendWriteRequest()
        {
            string       localFile  = "C:\\Users\\Matt McCormick\\Documents\\Schoolwork\\cs490st\\project01\\SpecExplorer2\\local.txt";
            BinaryReader fileStream = new BinaryReader(new FileStream(localFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite));

            byte[] sndBuffer;
            client.sendWriteRequest("remote.txt", "local.txt", TFTPClient.Modes.NetAscii, out sndBuffer);

            state = client.tftpClientMode;
        }
Exemplo n.º 2
0
 public void TestPutFineWrapper()
 {
     client.sendWriteRequest(remotePath, localPath, TFTPClient.Modes.Octet, out sndBuffer);
     client.Put(remotePath, localPath, TFTPClient.Modes.Octet);
     FileAssert.AreEqual(localPath, serverPath + remotePath);
 }
Exemplo n.º 3
0
 public static void StartWrite(int SelMode)
 {
     clnt.sendWriteRequest(remotePutPath, localPutPath, (TFTPClient.Modes)SelMode, out sndBuffer);
 }