Initial commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<AssemblyName>Bring2mind.DnnConnect2025Demo.SysMonitor</AssemblyName>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<OutputPath>bin</OutputPath>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||
<Authors>Peter Donker</Authors>
|
||||
<Company>Bring2mind</Company>
|
||||
<Product>dnnconnect2025demo</Product>
|
||||
<Copyright>Copyright 2025 by Bring2mind</Copyright>
|
||||
<PackageId>DnnConnect2025Demo</PackageId>
|
||||
<AssemblyVersion>0.0.1</AssemblyVersion>
|
||||
<FileVersion>0.0.1</FileVersion>
|
||||
<Description>DnnConnect2025Demo module</Description>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
<ApplicationIcon />
|
||||
<OutputType>Library</OutputType>
|
||||
<StartupObject />
|
||||
<DebugType>Portable</DebugType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DotNetNuke.Abstractions" Version="10.0.0" />
|
||||
<PackageReference Include="DotNetNuke.Core" Version="10.0.0" />
|
||||
<PackageReference Include="DotNetNuke.WebApi" Version="10.0.0" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Web" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
13
Server/SysMonitor/SysController.cs
Normal file
13
Server/SysMonitor/SysController.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using DotNetNuke.Application;
|
||||
using DotNetNuke.Web.Api;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Net;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Bring2mind.DnnConnect2025Demo.SysMonitor
|
||||
{
|
||||
public class SysController
|
||||
{
|
||||
}
|
||||
}
|
||||
40
Server/SysMonitor/SysMethods.cs
Normal file
40
Server/SysMonitor/SysMethods.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.IO;
|
||||
|
||||
namespace Bring2mind.DnnConnect2025Demo.SysMonitor
|
||||
{
|
||||
internal class SysMethods
|
||||
{
|
||||
public static string GetWebConfigMd5(string webConfigPath)
|
||||
{
|
||||
var fileBytes = File.ReadAllBytes(webConfigPath);
|
||||
var md5 = System.Security.Cryptography.MD5.Create();
|
||||
var hash = md5.ComputeHash(fileBytes);
|
||||
var md5String = System.BitConverter.ToString(hash).Replace("-", "").ToLower();
|
||||
return md5String;
|
||||
}
|
||||
|
||||
public static bool IsDirectoryWritable(string dirPath, bool throwIfFails = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (FileStream fs = File.Create(
|
||||
Path.Combine(
|
||||
dirPath,
|
||||
Path.GetRandomFileName()
|
||||
),
|
||||
1,
|
||||
FileOptions.DeleteOnClose)
|
||||
)
|
||||
{ }
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
if (throwIfFails)
|
||||
throw;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
16
Server/SysMonitor/dnn.json
Normal file
16
Server/SysMonitor/dnn.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"projectType": "library",
|
||||
"name": "Bring2mind_SysMonitor",
|
||||
"friendlyName": "Bring2mind SysMonitor",
|
||||
"description": "Bring2mind SysMonitor Library",
|
||||
"packageName": "Bring2mind_SysMonitor",
|
||||
"folder": "Bring2mind/SysMonitor",
|
||||
"library": {},
|
||||
"pathsAndFiles": {
|
||||
"pathToAssemblies": "./bin",
|
||||
"pathToScripts": "./Server/SqlScripts",
|
||||
"assemblies": ["Bring2mind.DnnConnect2025Demo.SysMonitor.dll"],
|
||||
"releaseFiles": [],
|
||||
"zipName": "Bring2mind.SysMonitor"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user