Skip to content

Class FileOut

Namespace: Tool.Web.Api
Assembly: Tool.Net.dll

系统默认 输出对象的实现类,文件输出处理

csharp
public class FileOut : ApiOut, IApiOut

Inheritance

objectApiOutFileOut

Implements

IApiOut

Inherited Members

ApiOut.ContentType, ApiOut.StatusCode, ApiOut.ExecuteOutAsync(AshxRouteData), ApiOut.Json(object), ApiOut.JsonAsync(object), ApiOut.Json(object, JsonSerializerOptions), ApiOut.JsonAsync(object, JsonSerializerOptions), ApiOut.Write(object), ApiOut.WriteAsync(object), ApiOut.View(), ApiOut.View(string), ApiOut.PathView(string), ApiOut.ViewAsync(), ApiOut.ViewAsync(string), ApiOut.PathViewAsync(string), ApiOut.File(string, Stream), ApiOut.FileAsync(string, Stream), ApiOut.File(string, byte[]), ApiOut.FileAsync(string, byte[]), ApiOut.Redirect(string), ApiOut.RedirectAsync(string), ApiOut.NoContent(), ApiOut.NoContentAsync(), ApiOut.EventStream(Func<EventStream, Task>, int), ApiOut.EventStreamAsync(Func<EventStream, Task>, int), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Extension Methods

ObjectExtension.Add<T>(object, object, object), ObjectExtension.CopyEntity(object, object, params string[]), ObjectExtension.EntityToJson(object), ObjectExtension.EntityToJson(object, bool), ObjectExtension.EntityToJson(object, bool, string), DictionaryExtension.GetDictionary(object), TypeExtension.GetFieldKey(object, string, out bool), TypeExtension.GetFieldKey<T>(object, string, out bool), TypeExtension.GetFieldKey(object, Type, string, out bool), ObjectExtension.GetIntPtr(object), ObjectExtension.GetIntPtrInt(object), TypeExtension.GetPropertieFind(object, string, bool), TypeExtension.GetProperties(object), TypeExtension.GetPropertyKey(object, string, out bool), TypeExtension.GetPropertyKey<T>(object, string, out bool), TypeExtension.GetPropertyKey(object, Type, string, out bool), TypeExtension.GetValue(object, PropertyDescriptor), TypeExtension.GetValue(object, string, bool), TypeExtension.GetValue(object, string), ObjectExtension.Read<T>(object, object, int, int), ObjectExtension.Read<T>(object, int, object, int, int), DictionaryExtension.SetDictionary(object, IDictionary<string, object>), TypeExtension.SetFieldKey(object, string, object), TypeExtension.SetFieldKey<T>(object, string, object), TypeExtension.SetFieldKey(object, Type, string, object), TypeExtension.SetPropertyKey(object, string, object), TypeExtension.SetPropertyKey<T>(object, string, object), TypeExtension.SetPropertyKey(object, Type, string, object), TypeExtension.SetValue(object, PropertyDescriptor, object), TypeExtension.SetValue(object, string, object, bool), TypeExtension.SetValue(object, string, object), ObjectExtension.ToBase64String(object), ObjectExtension.ToBytes(object), ObjectExtension.ToBytes(object, out Type), DictionaryExtension.ToDictionary(object), DictionaryExtension.ToDictionary<T>(object), DictionaryExtension.ToIDictionary(object), DictionaryExtension.ToIDictionary<T>(object), ObjectExtension.ToJson(object), ObjectExtension.ToJson(object, JsonSerializerOptions), ObjectExtension.ToJsonWeb(object), ObjectExtension.ToJsonWeb(object, Action<JsonSerializerOptions>), ObjectExtension.ToTryVar<T>(object, T), ObjectExtension.ToVar<T>(object), ObjectExtension.ToVar(object, Type, bool), ObjectExtension.ToVar(object, string), ObjectExtension.ToXml(object)

Remarks

代码由逆血提供支持

Constructors

FileOut(string, Stream)

初始化构造

csharp
public FileOut(string name, Stream fileStream)

Parameters

name string

文件名称

fileStream Stream

文件流对象

FileOut(string, byte[])

初始化构造

csharp
public FileOut(string name, byte[] bytes)

Parameters

name string

文件名称

bytes byte[]

文件字节流

Properties

ContentType

下载的文件格式

csharp
public override string ContentType { get; set; }

Property Value

string

FileStream

资源流对象

csharp
public Stream FileStream { get; set; }

Property Value

Stream

Name

下载文件名称

csharp
public string Name { get; set; }

Property Value

string

StatusCode

下载的状态码

csharp
public override int StatusCode { get; set; }

Property Value

int

Methods

ExecuteOutAsync(AshxRouteData)

下载核心任务对象

csharp
public override Task ExecuteOutAsync(AshxRouteData ashxRoute)

Parameters

ashxRoute AshxRouteData

核心传输对象

Returns

Task

返回任务

基于Apache-2.0协议开源