rainmeter-studio/RainmeterStudio.Core/Utils/PathHelper.cs

26 lines
637 B
C#
Raw Normal View History

2014-08-16 08:05:26 +00:00
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace RainmeterStudio.Core.Utils
{
public static class PathHelper
{
/// <summary>
/// Validates a path
/// </summary>
/// <param name="path">The path</param>
/// <returns>True if the path is valid</returns>
public static bool IsPathValid(string path)
{
// Check for invalid characters
if (Path.GetInvalidPathChars().Intersect(path).Any())
return false;
return true;
}
}
}