private static void UploadTestWithBase64() { while (true) { try { Console.WriteLine("please input file path and press enter"); var path = Console.ReadLine(); if (!System.IO.File.Exists(path)) { Console.WriteLine("不存在的文件"); break; } Base64File file = Base64File.FromFile(path, "dir2"); var result = new HttpClientUtil(uploadurl).PostWithJson <JsonResultData <FileInfo> >(uppath, file, new Dictionary <string, string> { ["Authorization"] = token }); Console.WriteLine("the result is :"); Console.WriteLine(result.Result); } catch (Exception ex) { Console.WriteLine(ex); } } }