批量数据上传客户端例子代码FastDFS

C# 2022-02-24 18:06:01

批量数据上传客户端例子代码FastDFS本实例在开发中有用的可以参考。

Console.Write("please input command[1,2,3,4]:");
var cmd = Console.ReadLine();

switch (cmd)
{
case "1":
ConnectionManager.InitializeForConfigSection(config);
break;

case "2":
storageNode = FastDFSClient.GetStorageNode(config.GroupName);
Console.WriteLine(storageNode.EndPoint);
break;

case "3":
fileName = FastDFSClient.UploadFile(storageNode, File.ReadAllBytes("test.jpg"), "jpg");
Console.WriteLine(fileName);
break;

case "4":
FastDFSClient.RemoveFile(config.GroupName, fileName);
break;
}