| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- using System;
- using System.Text.RegularExpressions;
- namespace DeviceCenter
- {
- class AcsUtil
- {
- public static string getCardNo(string input)
- {
- string pattern = @"\+Card Number\:(\d+)\+";
- try
- {
- return Regex.Matches(input, pattern)[0].Groups[1].Value;
- }
- catch
- {
- return null;
- }
- }
- public static string getDoorNo(string input)
- {
- string pattern = @"\+Door Number\:(\d+)\+";
- try
- {
- return Regex.Matches(input, pattern)[0].Groups[1].Value;
- }
- catch
- {
- return null;
- }
- }
- public static string getChannel(string input)
- {
- string pattern = @"\+wAccessChannel\:(\d+)\+";
- try
- {
- return Regex.Matches(input, pattern)[0].Groups[1].Value;
- }
- catch
- {
- return null;
- }
- }
- public static string getCardReaderNo(string input)
- {
- string pattern = @"\+Card Reader Number\:(\d+)\+";
- try
- {
- return Regex.Matches(input, pattern)[0].Groups[1].Value;
- }
- catch
- {
- return null;
- }
- }
- public static string getPicturePath(string input)
- {
- string pattern = @"SavePath\:(.+\.bmp)";
- try
- {
- return Regex.Matches(input, pattern)[0].Groups[1].Value;
- }
- catch
- {
- return null;
- }
- }
- }
- }
|