示例#1
0
 private async Task Download()
 {
     ServerInterface.ServerPacket sp = ServerInterface.ReadFile("/home/aio/AIO/ToDo.list");
     if (sp.Flags[1] == ServerInterface.ACK)
     {
         await StorageInterface.WriteBytesToLocalFolder("ToDo.list", sp.Message);
     }
 }
        private async void TestServer_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                //Debug.WriteLine(await ClintServerMethods.SendDataAndRecieveAnswer("localhost", 1337, "TEST REQUEST"));
                await ServerInterface.UploadFile(await StorageInterface.GetStorageFileFromToken(await StorageInterface.PickExternalStorageFile_OpenFile()), "/CODE/IMG.png");// "C:\\Users\\alder\\Desktop\\IMG.png", "localhost");

                //ServerInterface.ReadFile("invalidTestFile");//if reading a non-existent file I get 0x15 (NAK) in flags[1]
            }
            catch (Exception ex)
            {
                ex.PrintStackTrace();
            }
        }
示例#3
0
 private async Task Upload()
 {
     await ServerInterface.UploadFile(await StorageInterface.GetStorageFileFromLocalStorage("ToDo.list"), "/home/aio/AIO/ToDo.list");
 }