123456789101112131415161718192021222324252627282930 |
- // <author></author>
- // <date></date>
- // <description></description>
- namespace ERP.Framework.Utils
- {
- public class UrlUtil
- {
- public static bool Match(string pattern, string path)
- {
- string[] patternParts = pattern.Split('*', StringSplitOptions.RemoveEmptyEntries);
- int currentIndex = 0;
- foreach (string patternPart in patternParts)
- {
- int index = path.IndexOf(patternPart, currentIndex, StringComparison.OrdinalIgnoreCase);
- if (index == -1)
- {
- return false;
- }
- currentIndex = index + patternPart.Length;
- }
- return true;
- }
- }
- }
|