From 0ae14c7a672576345ce3873cd8a879995e244744 Mon Sep 17 00:00:00 2001 From: Zontreck Date: Wed, 9 Sep 2020 16:34:18 -0700 Subject: [PATCH] change compiler options, add function to tools.cs --- LibZNI.csproj | 1 - Tools.cs | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/LibZNI.csproj b/LibZNI.csproj index 512f564..1281a8d 100644 --- a/LibZNI.csproj +++ b/LibZNI.csproj @@ -5,7 +5,6 @@ netcoreapp3.0 true false - true false Debug;Release;DebPub;KVPBuild diff --git a/Tools.cs b/Tools.cs index 2bd90b4..05fa7e2 100644 --- a/Tools.cs +++ b/Tools.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Security.Cryptography; using System.Text; @@ -64,6 +65,21 @@ namespace LibZNI var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData); return System.Text.Encoding.UTF8.GetString(base64EncodedBytes); } + + public static string GoUpOneLevel(string path) + { + string[] paths = path.Split(new[] { '/', '\\' }); + + List pathList = paths.ToList(); + pathList.Remove(pathList[pathList.Count-1]); + + string pathListStr = ""; + foreach(string s in pathList) + { + pathListStr += s + "/"; + } + return pathListStr; + } }