C# Class Senparc.Weixin.MP.AdvancedAPIs.MediaApi

素材管理接口(原多媒体文件接口)
ファイルを表示 Open project: JeffreySu/WeiXinMPSDK

Public Methods

Method Description
DeleteForeverMedia ( string accessTokenOrAppId, string mediaId, int timeOut = Config.TIME_OUT ) : WxJsonResult

删除永久素材

DeleteForeverMediaAsync ( string accessTokenOrAppId, string mediaId, int timeOut = Config.TIME_OUT ) : Task

【异步方法】删除永久素材

Get ( string accessToken, string mediaId, string dir ) : string
Get ( string accessToken, string mediaId, Stream stream ) : void

获取临时素材(原下载媒体文件)

GetAsync ( string accessToken, string mediaId, Stream stream ) : System.Threading.Tasks.Task

【异步方法】获取临时素材(原下载媒体文件)

GetForeverMedia ( string accessToken, string mediaId, Stream stream ) : void

获取永久素材(除了图文)

GetForeverMediaAsync ( string accessToken, string mediaId, Stream stream ) : System.Threading.Tasks.Task

【异步方法】获取永久素材(除了图文)

GetForeverNews ( string accessTokenOrAppId, string mediaId, int timeOut = Config.TIME_OUT ) : GetNewsResultJson

获取永久图文素材

GetForeverNewsAsync ( string accessTokenOrAppId, string mediaId, int timeOut = Config.TIME_OUT ) : Task

【异步方法】获取永久图文素材

GetMediaCount ( string accessTokenOrAppId ) : GetMediaCountResultJson

获取素材总数 永久素材的总数,也会计算公众平台官网素材管理中的素材 图片和图文消息素材(包括单图文和多图文)的总数上限为5000,其他素材的总数上限为1000

GetMediaCountAsync ( string accessTokenOrAppId ) : Task

【异步方法】获取素材总数 永久素材的总数,也会计算公众平台官网素材管理中的素材 图片和图文消息素材(包括单图文和多图文)的总数上限为5000,其他素材的总数上限为1000

GetNewsMediaList ( string accessTokenOrAppId, int offset, int count, int timeOut = Config.TIME_OUT ) : MediaList_NewsResult

获取图文素材列表

GetNewsMediaListAsync ( string accessTokenOrAppId, int offset, int count, int timeOut = Config.TIME_OUT ) : Task

【异步方法】获取图文素材列表

GetOthersMediaList ( string accessTokenOrAppId, UploadMediaFileType type, int offset, int count, int timeOut = Config.TIME_OUT ) : MediaList_OthersResult

获取图片、视频、语音素材列表

GetOthersMediaListAsync ( string accessTokenOrAppId, UploadMediaFileType type, int offset, int count, int timeOut = Config.TIME_OUT ) : Task

【异步方法】获取图片、视频、语音素材列表

UpdateForeverNews ( string accessTokenOrAppId, string mediaId, int index, NewsModel news, int timeOut = Config.TIME_OUT ) : WxJsonResult

修改永久图文素材

UpdateForeverNewsAsync ( string accessTokenOrAppId, string mediaId, int index, NewsModel news, int timeOut = Config.TIME_OUT ) : Task

【异步方法】修改永久图文素材

UploadForeverMedia ( string accessTokenOrAppId, string file, int timeOut = Config.TIME_OUT ) : UploadForeverMediaResult

新增其他类型永久素材(图片(image)、语音(voice)和缩略图(thumb))

UploadForeverMediaAsync ( string accessTokenOrAppId, string file, int timeOut = Config.TIME_OUT ) : Task

【异步方法】新增其他类型永久素材(图片(image)、语音(voice)和缩略图(thumb))

UploadForeverVideo ( string accessTokenOrAppId, string file, string title, string introduction, int timeOut = 40000 ) : UploadForeverMediaResult

新增永久视频素材

UploadForeverVideoAsync ( string accessTokenOrAppId, string file, string title, string introduction, int timeOut = 40000 ) : Task

【异步方法】新增永久视频素材

UploadImg ( string accessTokenOrAppId, string file, int timeOut = Config.TIME_OUT ) : UploadImgResult

上传图文消息内的图片获取URL

UploadImgAsync ( string accessTokenOrAppId, string file, int timeOut = Config.TIME_OUT ) : Task

【异步方法】上传图文消息内的图片获取URL

UploadNews ( string accessTokenOrAppId, int timeOut = Config.TIME_OUT ) : UploadForeverMediaResult

新增永久图文素材

UploadNewsAsync ( string accessTokenOrAppId, int timeOut = Config.TIME_OUT ) : Task

【异步方法】新增永久图文素材

UploadTemporaryMedia ( string accessTokenOrAppId, UploadMediaFileType type, string file, int timeOut = Config.TIME_OUT ) : UploadTemporaryMediaResult

新增临时素材(原上传媒体文件)

UploadTemporaryMediaAsync ( string accessTokenOrAppId, UploadMediaFileType type, string file, int timeOut = Config.TIME_OUT ) : Task

【异步方法】新增临时素材(原上传媒体文件)

UploadTemporaryNews ( string accessTokenOrAppId, int timeOut = Config.TIME_OUT ) : UploadTemporaryMediaResult

上传临时图文消息素材(原上传图文消息素材)

UploadTemporaryNewsAsync ( string accessTokenOrAppId, int timeOut = Config.TIME_OUT ) : Task

【异步方法】上传临时图文消息素材(原上传图文消息素材)

Method Details

DeleteForeverMedia() public static method

删除永久素材
public static DeleteForeverMedia ( string accessTokenOrAppId, string mediaId, int timeOut = Config.TIME_OUT ) : WxJsonResult
accessTokenOrAppId string
mediaId string
timeOut int 代理请求超时时间(毫秒)
return Senparc.Weixin.Entities.WxJsonResult

DeleteForeverMediaAsync() public static method

【异步方法】删除永久素材
public static DeleteForeverMediaAsync ( string accessTokenOrAppId, string mediaId, int timeOut = Config.TIME_OUT ) : Task
accessTokenOrAppId string
mediaId string
timeOut int 代理请求超时时间(毫秒)
return Task

Get() public static method

public static Get ( string accessToken, string mediaId, string dir ) : string
accessToken string
mediaId string
dir string
return string

Get() public static method

获取临时素材(原下载媒体文件)
public static Get ( string accessToken, string mediaId, Stream stream ) : void
accessToken string
mediaId string
stream System.IO.Stream
return void

GetAsync() public static method

【异步方法】获取临时素材(原下载媒体文件)
public static GetAsync ( string accessToken, string mediaId, Stream stream ) : System.Threading.Tasks.Task
accessToken string
mediaId string
stream System.IO.Stream
return System.Threading.Tasks.Task

GetForeverMedia() public static method

获取永久素材(除了图文)
public static GetForeverMedia ( string accessToken, string mediaId, Stream stream ) : void
accessToken string
mediaId string
stream System.IO.Stream
return void

GetForeverMediaAsync() public static method

【异步方法】获取永久素材(除了图文)
public static GetForeverMediaAsync ( string accessToken, string mediaId, Stream stream ) : System.Threading.Tasks.Task
accessToken string
mediaId string
stream System.IO.Stream
return System.Threading.Tasks.Task

GetForeverNews() public static method

获取永久图文素材
public static GetForeverNews ( string accessTokenOrAppId, string mediaId, int timeOut = Config.TIME_OUT ) : GetNewsResultJson
accessTokenOrAppId string
mediaId string
timeOut int 代理请求超时时间(毫秒)
return Senparc.Weixin.MP.AdvancedAPIs.Media.GetNewsResultJson

GetForeverNewsAsync() public static method

【异步方法】获取永久图文素材
public static GetForeverNewsAsync ( string accessTokenOrAppId, string mediaId, int timeOut = Config.TIME_OUT ) : Task
accessTokenOrAppId string
mediaId string
timeOut int 代理请求超时时间(毫秒)
return Task

GetMediaCount() public static method

获取素材总数 永久素材的总数,也会计算公众平台官网素材管理中的素材 图片和图文消息素材(包括单图文和多图文)的总数上限为5000,其他素材的总数上限为1000
public static GetMediaCount ( string accessTokenOrAppId ) : GetMediaCountResultJson
accessTokenOrAppId string
return Senparc.Weixin.MP.AdvancedAPIs.Media.GetMediaCountResultJson

GetMediaCountAsync() public static method

【异步方法】获取素材总数 永久素材的总数,也会计算公众平台官网素材管理中的素材 图片和图文消息素材(包括单图文和多图文)的总数上限为5000,其他素材的总数上限为1000
public static GetMediaCountAsync ( string accessTokenOrAppId ) : Task
accessTokenOrAppId string
return Task

GetNewsMediaList() public static method

获取图文素材列表
public static GetNewsMediaList ( string accessTokenOrAppId, int offset, int count, int timeOut = Config.TIME_OUT ) : MediaList_NewsResult
accessTokenOrAppId string
offset int 从全部素材的该偏移位置开始返回,0表示从第一个素材 返回
count int 返回素材的数量,取值在1到20之间
timeOut int 代理请求超时时间(毫秒)
return Senparc.Weixin.MP.AdvancedAPIs.Media.MediaList_NewsResult

GetNewsMediaListAsync() public static method

【异步方法】获取图文素材列表
public static GetNewsMediaListAsync ( string accessTokenOrAppId, int offset, int count, int timeOut = Config.TIME_OUT ) : Task
accessTokenOrAppId string
offset int 从全部素材的该偏移位置开始返回,0表示从第一个素材 返回
count int 返回素材的数量,取值在1到20之间
timeOut int 代理请求超时时间(毫秒)
return Task

GetOthersMediaList() public static method

获取图片、视频、语音素材列表
public static GetOthersMediaList ( string accessTokenOrAppId, UploadMediaFileType type, int offset, int count, int timeOut = Config.TIME_OUT ) : MediaList_OthersResult
accessTokenOrAppId string
type UploadMediaFileType 素材的类型,图片(image)、视频(video)、语音 (voice)
offset int
count int
timeOut int
return Senparc.Weixin.MP.AdvancedAPIs.Media.MediaList_OthersResult

GetOthersMediaListAsync() public static method

【异步方法】获取图片、视频、语音素材列表
public static GetOthersMediaListAsync ( string accessTokenOrAppId, UploadMediaFileType type, int offset, int count, int timeOut = Config.TIME_OUT ) : Task
accessTokenOrAppId string
type UploadMediaFileType 素材的类型,图片(image)、视频(video)、语音 (voice)
offset int
count int
timeOut int
return Task

UpdateForeverNews() public static method

修改永久图文素材
public static UpdateForeverNews ( string accessTokenOrAppId, string mediaId, int index, NewsModel news, int timeOut = Config.TIME_OUT ) : WxJsonResult
accessTokenOrAppId string
mediaId string 要修改的图文消息的id
index int 要更新的文章在图文消息中的位置(多图文消息时,此字段才有意义),第一篇为0
news NewsModel 图文素材
timeOut int 代理请求超时时间(毫秒)
return Senparc.Weixin.Entities.WxJsonResult

UpdateForeverNewsAsync() public static method

【异步方法】修改永久图文素材
public static UpdateForeverNewsAsync ( string accessTokenOrAppId, string mediaId, int index, NewsModel news, int timeOut = Config.TIME_OUT ) : Task
accessTokenOrAppId string
mediaId string 要修改的图文消息的id
index int 要更新的文章在图文消息中的位置(多图文消息时,此字段才有意义),第一篇为0
news NewsModel 图文素材
timeOut int 代理请求超时时间(毫秒)
return Task

UploadForeverMedia() public static method

新增其他类型永久素材(图片(image)、语音(voice)和缩略图(thumb))
public static UploadForeverMedia ( string accessTokenOrAppId, string file, int timeOut = Config.TIME_OUT ) : UploadForeverMediaResult
accessTokenOrAppId string
file string 文件路径
timeOut int 代理请求超时时间(毫秒)
return Senparc.Weixin.MP.AdvancedAPIs.Media.UploadForeverMediaResult

UploadForeverMediaAsync() public static method

【异步方法】新增其他类型永久素材(图片(image)、语音(voice)和缩略图(thumb))
public static UploadForeverMediaAsync ( string accessTokenOrAppId, string file, int timeOut = Config.TIME_OUT ) : Task
accessTokenOrAppId string
file string 文件路径
timeOut int 代理请求超时时间(毫秒)
return Task

UploadForeverVideo() public static method

新增永久视频素材
public static UploadForeverVideo ( string accessTokenOrAppId, string file, string title, string introduction, int timeOut = 40000 ) : UploadForeverMediaResult
accessTokenOrAppId string
file string 文件路径
title string
introduction string
timeOut int 代理请求超时时间(毫秒)
return Senparc.Weixin.MP.AdvancedAPIs.Media.UploadForeverMediaResult

UploadForeverVideoAsync() public static method

【异步方法】新增永久视频素材
public static UploadForeverVideoAsync ( string accessTokenOrAppId, string file, string title, string introduction, int timeOut = 40000 ) : Task
accessTokenOrAppId string
file string 文件路径
title string
introduction string
timeOut int 代理请求超时时间(毫秒)
return Task

UploadImg() public static method

上传图文消息内的图片获取URL
public static UploadImg ( string accessTokenOrAppId, string file, int timeOut = Config.TIME_OUT ) : UploadImgResult
accessTokenOrAppId string
file string
timeOut int
return Senparc.Weixin.MP.AdvancedAPIs.Media.UploadImgResult

UploadImgAsync() public static method

【异步方法】上传图文消息内的图片获取URL
public static UploadImgAsync ( string accessTokenOrAppId, string file, int timeOut = Config.TIME_OUT ) : Task
accessTokenOrAppId string
file string
timeOut int
return Task

UploadNews() public static method

新增永久图文素材
public static UploadNews ( string accessTokenOrAppId, int timeOut = Config.TIME_OUT ) : UploadForeverMediaResult
accessTokenOrAppId string Token
timeOut int 代理请求超时时间(毫秒)
return Senparc.Weixin.MP.AdvancedAPIs.Media.UploadForeverMediaResult

UploadNewsAsync() public static method

【异步方法】新增永久图文素材
public static UploadNewsAsync ( string accessTokenOrAppId, int timeOut = Config.TIME_OUT ) : Task
accessTokenOrAppId string Token
timeOut int 代理请求超时时间(毫秒)
return Task

UploadTemporaryMedia() public static method

新增临时素材(原上传媒体文件)
public static UploadTemporaryMedia ( string accessTokenOrAppId, UploadMediaFileType type, string file, int timeOut = Config.TIME_OUT ) : UploadTemporaryMediaResult
accessTokenOrAppId string
type UploadMediaFileType
file string
timeOut int 代理请求超时时间(毫秒)
return Senparc.Weixin.MP.AdvancedAPIs.Media.UploadTemporaryMediaResult

UploadTemporaryMediaAsync() public static method

【异步方法】新增临时素材(原上传媒体文件)
public static UploadTemporaryMediaAsync ( string accessTokenOrAppId, UploadMediaFileType type, string file, int timeOut = Config.TIME_OUT ) : Task
accessTokenOrAppId string
type UploadMediaFileType
file string
timeOut int 代理请求超时时间(毫秒)
return Task

UploadTemporaryNews() public static method

上传临时图文消息素材(原上传图文消息素材)
public static UploadTemporaryNews ( string accessTokenOrAppId, int timeOut = Config.TIME_OUT ) : UploadTemporaryMediaResult
accessTokenOrAppId string Token
timeOut int 代理请求超时时间(毫秒)
return Senparc.Weixin.MP.AdvancedAPIs.Media.UploadTemporaryMediaResult

UploadTemporaryNewsAsync() public static method

【异步方法】上传临时图文消息素材(原上传图文消息素材)
public static UploadTemporaryNewsAsync ( string accessTokenOrAppId, int timeOut = Config.TIME_OUT ) : Task
accessTokenOrAppId string Token
timeOut int 代理请求超时时间(毫秒)
return Task