我正在尝试使用 api,但我无法调用此类的任何方法
namespace Ipfs.Api
{
/// <summary>
/// Manages the files/directories in IPFS.
/// </summary>
/// <remarks>
/// <para>
/// This API is accessed via the <see cref="IpfsClient.FileSystem"/> property.
/// </para>
/// </remarks>
/// <seealso href="https://github.com/ipfs/interface-ipfs-core/tree/master/API/files">Files API</seealso>
public class FileSystemApi
{
IpfsClient ipfs;
Lazy<DagNode> emptyFolder;
internal FileSystemApi(IpfsClient ipfs)
{
this.ipfs = ipfs;
this.emptyFolder = new Lazy<DagNode>(() => ipfs.Object.NewDirectoryAsync().Result);
}
/// <summary>
/// Add a file to the interplanetary file system.
/// </summary>
/// <param name="path"></param>
public Task<FileSystemNode> AddFileAsync(string path)
{
return AddAsync(
new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read),
Path.GetFileName(path));
}
}
我想在不修改的情况下使用 API,我不能声明一个对象,因为我不能调用任何构造函数,我不能调用任何没有对象的方法,因为它们不是静态的。
我应该怎么办?