Discuz.Web.Services/RESTServer.cs
(开头部分) 10KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using Discuz.Config;
using Discuz.Web.Services.API.Actions;
using Discuz.Common;
using System.Reflection;
using Discuz.Web.Services.API;
using System.Web;
using System.Collections;
using System.Security.Cryptography;
using Discuz.Forum;
using Newtonsoft.Json;
namespace Discuz.Web.Services
{
public class RESTServer : Page
{
private static ErrorDetails _errorDetails = new ErrorDetails();
public RESTServer()
{
this.Load += new EventHandler(RESTServer_Load);
}
void RESTServer_Load(object sender, EventArgs e)
{
Response.Clear();
Response.ContentType = "text/xml";
APIConfigInfo apiInfo = APIConfigs.GetConfig();
if (!apiInfo.Enable)
{
ResponseErrorInfo((int)ErrorType.API_EC_SERVICE);
return;
}
//check sig
DNTParam[] parameters = GetParamsFromRequest(Request);
//GetRequests
/*---- optional ----*/
//format
string format = DNTRequest.GetString("format");
//callback
string callback = DNTRequest.GetString("callback");
/*---- required ----*/
//api_key
string api_key = DNTRequest.GetString("api_key");
//整合程序对象
ApplicationInfo appInfo = null;
ApplicationInfoCollection appcollection = apiInfo.AppCollection;
foreach (ApplicationInfo newapp in appcollection)
{
后面还有 245 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
