日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > asp.net >内容正文

asp.net

金山文档服务器暂不可用,wps金山文档在线编辑--.Net 接入指南

發布時間:2023/12/20 asp.net 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 金山文档服务器暂不可用,wps金山文档在线编辑--.Net 接入指南 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

///

///獲取文件元數據///

///

[Route("v1/3rd/file/info")]

[HttpGet]public JsonResult info(string _w_signature,string_w_appid)

{var res = newJsonResult();

response_wpsModel wpsModel= newresponse_wpsModel();

userModel user= newuserModel();

user.id= "576590854";

user.name= "kls-dev";

//用戶權限

user.permission= "write";

user.avatar_url= "http://XXXXX.com/圖片20180813135932.jpg";

fileModel f= newfileModel();

//文件主鍵,要確保唯一

f.id= "id2019110609261";

f.name= "文件名.xlsx";

f.version= 1;

f.size= 200;

f.creator=user.name;

f.create_time= long.Parse(TimeHelper.GetCurrentTimestamp(false));

f.modifier=user.name;

f.modify_time=long.Parse(TimeHelper.GetCurrentTimestamp(false)) ;

//文件的云地址

f.download_url= "";

user_aclModel acl= newuser_aclModel();

acl.rename= 1;

acl.history= 1;

f.user_acl=acl;

f.watermark=newwatermarkModel();

wpsModel.file=f;

wpsModel.user=user;returnJson(wpsModel,JsonRequestBehavior.AllowGet);

}

//補充時間戳幫助類

///

/// 時間相關

///

public static class TimeHelper

{

///

/// 獲取當前時間戳

///

/// 精度(毫秒)設置 true,則生成13位的時間戳;精度(秒)設置為 false,則生成10位的時間戳;默認為 true

///

public static string GetCurrentTimestamp(bool millisecond = true)

{

return DateTime.Now.ToTimestamp(millisecond);

}

///

/// 轉換指定時間得到對應的時間戳

///

///

/// 精度(毫秒)設置 true,則生成13位的時間戳;精度(秒)設置為 false,則生成10位的時間戳;默認為 true

/// 返回對應的時間戳

public static string ToTimestamp(this DateTime dateTime, bool millisecond = true)

{

return dateTime.ToTimestampLong(millisecond).ToString();

}

///

/// 轉換指定時間得到對應的時間戳

///

///

/// 精度(毫秒)設置 true,則生成13位的時間戳;精度(秒)設置為 false,則生成10位的時間戳;默認為 true

/// 返回對應的時間戳

public static long ToTimestampLong(this DateTime dateTime, bool millisecond = true)

{

var ts = dateTime.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, 0);

return millisecond ? Convert.ToInt64(ts.TotalMilliseconds) : Convert.ToInt64(ts.TotalSeconds);

}

///

/// 轉換指定時間戳到對應的時間

///

/// (10位或13位)時間戳

/// 返回對應的時間

public static DateTime ToDateTime(this string timestamp)

{

var tz = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1, 0, 0, 0, 0));

return timestamp.Length == 13

? tz.AddMilliseconds(Convert.ToInt64(timestamp))

: tz.AddSeconds(Convert.ToInt64(timestamp));

}

}

總結

以上是生活随笔為你收集整理的金山文档服务器暂不可用,wps金山文档在线编辑--.Net 接入指南的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。