Rox 是一个使用 C# .NET Framework 4.7.2 编写,并使用 Microsoft Visual Studio 2026 编译的跨平台动态链接库。它提供了多种功能模块,包括日志记录、文件操作、网络检查、API请求多种功能、Windows 系统配置等。
更新到 2026年1月4日 6:53 PM.
This project is licensed under AGPL-3.0 + Attribution + Non-Commercial terms.
- 🔍 You must:
- Keep original author attribution and repository link.
- Open-source any modified versions under AGPL-3.0.
- 🚫 You cannot:
- Use this code (or derivatives) for commercial purposes.
- 📂 See LICENSE for full terms.
本项目采用 AGPL-3.0 + 署名 + 非商业附加条款 许可协议。
- 🔍 您必须:
- 保留原始作者署名及仓库链接。
- 任何修改后的版本必须以 AGPL-3.0 协议开源。
- 🚫 您不得:
- 将此代码(或衍生作品)用于商业用途。
- 📂 完整条款参见 LICENSE。
Rox.Runtimes.LogLibraries.WriteLog.Info(LogKind logkind,string message);
Rox.Runtimes.LogLibraries.WriteLog.Warning(string logkind,string message);
Rox.Runtimes.LogLibraries.WriteLog.Error(string message);
Rox.Runtimes.LogLibraries.WriteLog.Debug(string message);支持3种重载, 可以自定义LogKind的类型, 显式使用字符串作为
LogKind: 日志报告的类型 可用枚举详见Rox.Runtimes.LogLibraries.LogKind
Rox.Runtimes.LogLibraries.LogToFile(LogLevel loglevel,LogKind logkind, string message);
Rox.Runtimes.LogLibraries.LogToFile
Rox.Runtimes.LogLibraries.LogToFile(LogLevel loglevel, string message);调用此方法时,会程序目录下创建log.ralog日志文件,并会以下格式写入文件
$"{DateTime.Now:yyyy-MM-dd HH:mm:ss} [{logLevel}] [{logkind}]: {message}";
Rox.Runtimes.LogLibraries.ClearFile(string filePath);filepath: 日志文件路径
Rox.DownloadAssistant.Downloader(string url);
Rox.DownloadAssistant.Downloader(string[] url);
Rox.DownloadAssistant.Downloader(string url,string location);
Rox.DownloadAssistant.Downloader(string url,string location);
Rox.DownloadAssistant.Downloader(string url,string location,bool log);
+2 重载...-
url(s): 下载链接 -
location: 下载位置 -
log: 是否启用日志输出
当log为true时,日志会输出到程序目录下的aria2c.log文件内,反之false则不会.
bool Rox.Security.Is360SafeRunning();
bool Rox.Security.IsHuorongSecurityRunning();- 返回值:
true表示安全软件正在运行,false表示未运行。
bool Rox.Runtimes.Network_I.IsNetworkAvailable();- 返回值:
true表示网络可用,false表示网络不可用。
Warning
此操作执行后可能会影响系统性能和安全。
Rox.Windows.Hibernate.Enable(); //启用休眠
Rox.Windows.Hibernate.Disable(); //禁用休眠Rox.Windows.EnableHighPowercfg(); //启用卓越性能Rox.Security.WindowsSecurityCenter.Enable() //启用
Rox.Security.WindowsSecurityCenter.Disable() //禁用bool Rox.Windows.WindowsUpdate.CheckStatus();- 返回类型:
bool - 返回值: 已禁用更新返回
false.已启用更新返回true,键值不存在或遇到未知错误返回false
Rox.Runtimes.Registry_I.Write(string keyPath,string valueName,object valueData,RegistryValueKind valueType);-
keyPath: 设定注册表路径 -
valueName: 设定注册表项名称 -
RegistryKind可用枚举:DWord,QWord,String等,详细帮助请查看官方界面 -
valueType:设定注册表项内数据类型 -
valueData:设定注册表项内数据
___ #### 读取注册表项值
Rox.Runtimes.Registry_I.GetRegistryValue(string keyName, string valueName);-
keyname: 注册表项的路径 -
valuename: 注册表项的名称 -
返回类型:
string
Rox.Runtimes.File_I.FileProperties(string path, Properties key, bool Enable);path: 文件的路径Properties可用枚举:System(设置文件为系统文件),Hidden(设置文件为受保护的隐藏文件),Readonly(设置文件为只读),Archive(设置文件为可存档文件).key: 文件属性Enable: 启用或取消属性: 设置为true时,给出的命令为+r(示例);设置为false时,给出的命令为-r(示例).
bool Rox.Runtimes.File_I.CheckFileHash(string filePath, string expectedMD5);filePath: 文件路径expectedMD5: 期望的MD5哈希值- 返回类型:
bool - 返回值: 文件的MD5哈希值与期望的MD5哈希值相同时,返回
true,反之则为false.
Rox.Runtimes.File_I.CalculateMD5(string filePath);filePath: 文件路径- 返回类型:
string - 返回值: 文件的MD5哈希值
bool Rox.Windows.Authentication();- 返回类型:
bool - 返回值:
true表示验证成功,false表示取消操作
Rox.Text.Json.DeserializeObject<T>(string json);
Rox.Text.Json.DeserializeObject(string json);json: Json字符串- 返回类型:
<T> JObject - 返回值: 返回反序列化后的对象
注:
<dynamic>已经包含在 DeserializeObject(string json) 方法中,因为返回类型是<dynamic>,所以不需要额外的方法。
Rox.Text.Json.SerializeObject(object obj);obj: 对象- 返回类型:
string - 返回值: 返回序列化后的Json字符串
await Rox.GameExpansionFeatures.SteamUserData_v1.GetDataJson_v1(string SteamID);
var type = await Rox.GameExpansionFeatures.SteamUserData_v1.GetDataJson_v1(SteamID);
var info = type.$SteamType$;steamID: SteamID,支持SteamID3,ID64,个人主页链接,自定义URL,好友代码
$SteamType$: 实际的 SteamType 属性
属性 注释 longsteamidSteamID64 ( 7656xxxxxxxx ) intcommunityvisibilitystate社区隐私状态, 1 为可见 3为隐藏 intprofilestate如果属性返回 1 代表用户已经填写了个人资料 personaname 用户名 profileurl 带有转义符的个人主页链接(https:\/\/) profileurl_1 无转义符的个人主页链接 avator 带有转义字符的头像链接(https:\/\/) avator_1 无转义符的头像链接 intpersonastate在线状态, 0-离线, 1-在线
2-忙碌, 3-离开, 4-打盹, 5-想交易, 6-想玩。realname 真实姓名 primaryclanid 主要组ID timecreated_str 创建账号时间 loccountrycode 账号绑定区域 (US/CN/HK) friendcode 好友代码 steamID3 SteamID3 ( [U:1:xxxxxxx] )
- 返回类型:
Json - 返回值: 返回Steam用户信息
//获取返回的Json
await Rox.API.Weather_v1.GetWeatherDataJson(string city,bool extended = false, bool indices = false, bool forecast = false);
await Rox.API.Weather_v1.GetWeatherDataJson(int adcode,bool extended = false, bool indices = false, bool forecast = false);
string advice = [$WeatherObject$].life_indices.[$Life_Indices$].[$IndicesLevel$];
举个例子:
var allweather = await Rox.API.Weather_v1.GetWeatherDataJson("东城区");
var allweather = await Rox.API.Weather_v1.GetWeatherDataJson(101101);
string temperature = allweather.temperature_1; //获取气温属性值
foreach (var _data in allweather.forecast)
{
WriteLog.Info("Weather Forcast", $"{_data.date} 的天气预报:\n" +
$"白天天气: {_data.weather_day}, 夜间天气: {_data.weather_night}\n" +
$"最高温度: {_data.temp_max} ℃, 最低温度: {_data.temp_min} ℃\n" +
$"降水量: {_data.precip} mm, 能见度: {_data.visibility} km, 紫外线指数: {_data.uv_index}");
}
string advice = allweather.life_indices.uv.advice;[!INFO] 提示:
单击展开属性列表
$IndicesLevel$: 实际的 IndicesLevel 属性
属性 注释 level 指数等级 brief 指数简述 advice 指数建议
$WeatherType$: 实际的 WeatherType 属性
属性 注释 code 错误代码 province 省份名称 city 城市名称 intadcode高德6位数字城市编码 weather 天气状况 doubletemperature气温 wind_direction 风向 wind_power 风力等级 inthumidty湿度 % report_time 天气的更新时间 message 错误信息 doubletemp_max最高气温 doubletemp_min最低气温
extended: 是否返回扩展气象字段(体感温度、能见度、气压、紫外线指数、空气质量、降水量、云量):
属性 注释 doublefeels_like体感温度 intvisibility能见度 km intpressure气压 hPa doubleuv紫外线指数 intaqi空气质量指数 intprecipitation降水量 mm intcloud云量 %
indices: 是否返回生活指数(穿衣、紫外线、洗车、晾晒、空调、感冒、运动、舒适度)
[!INFO] 提示: 位于
Life_Indices的所有属性均为<IndicesLevel>类, 请参考README的Json反序列化步骤
属性 注释 clothing 穿衣指数 uv 紫外线指数 car_wash 洗车指数 drying 晾晒指数 air_conditioner 空调指数 cold_risk 感冒指数 exercise 运动指数 comfort 舒适度指数
forecast: 是否返回预报数据(当日最高/最低气温及未来3天天气预报)
属性 注释 List<Forcast>forcast未来三天的天气预报 date 预告日期 doubletemp_max最高气温 doubletemp_mix最低气温 weather_day 白天天气 weather_night 夜间天气 inthumidity湿度 % intprecip降水量 mm intvisibility能见度 km doubleuv_index紫外线指数 0-11+
$WeatherObject$: 实际的 WeatherType Jobject 对象$Life_Indices$: 实际的 life_indices 属性city: 指定的地区adcode: 高德地图的6位数字城市编码- 返回类型:
JObject - 返回值: 天气信息
Rox.GameExpansionFeatures.Steam.GetSteamPath();- 返回类型:
string - 返回值: Steam 安装文件夹
Rox.GameExpansionFeatures.CSGO.GetCS2Path();- 返回类型:
string - 返回值: CS2的存放文件夹路径
Rox.GameExpansionFeatures.Minecraft.TradingWithHeroOfVillage_Calculator(int BasePrice, int HearoOfVillage_Level);- BasePrice: 基础价格
- HearoOfVillage_Level: "村庄英雄"效果等级, 范围 1-5
- 返回类型:
int - 返回值: 计算后的交易价格
await Rox.GameExpansionFeatures.EpicGames.GetFreeGames.GetDataJson()- 返回类型:
Json - 返回值: 一个或多个免费游戏的详细列表
附: EpicType属性
属性 注释 id Epic游戏的唯一标识符 title 游戏的完整标题名称 cover 封面图片的URL地址 intoriginal_price游戏原价 单位 CNY¥ original_price_desc 格式化后的原价描述字符串 description 游戏的简介描述 seller 发行商 boolis_free_now当前是否免费 free_start 免费开始时间的可读字符串格式 free_end 免费结束时间的可读字符串格式 link 游戏在Epic Games商店的详情页链接 message 错误信息
- 系统要求
- Windows 11 版本 21H2 或更高版本:家庭版、专业版、专业教育版、专业工作站版、企业版和教育版
- Windows 10 版本 1909 或更高版本:家庭版、专业版、教育版和企业版。
- 64 位操作系统, 基于 x64 的处理器
- 工作负荷
- 桌面应用和移动应用
- .NET 桌面开发
- 编译语言
- C# .NET Framework 4.7.2
- 依赖项
- 视觉窗体库 AntdUI
- Json处理 Newtonsoft.Json
(部分使用, 大部分使用项目内的
Rox.Text.Json进行简单反/序列化)
- 扩展
以下扩展均为 Visual Studio 2026 版本适用的扩展
