1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Utilities;
- namespace SMBLibrary.SMB1
- {
- public class ServiceNameHelper
- {
- public static string GetServiceString(ServiceName serviceName)
- {
- switch (serviceName)
- {
- case ServiceName.DiskShare:
- return "A:";
- case ServiceName.PrinterShare:
- return "LPT1:";
- case ServiceName.NamedPipe:
- return "IPC";
- case ServiceName.SerialCommunicationsDevice:
- return "COMM";
- default:
- return "?????";
- }
- }
- public static ServiceName GetServiceName(string serviceString)
- {
- switch (serviceString)
- {
- case "A:":
- return ServiceName.DiskShare;
- case "LPT1:":
- return ServiceName.PrinterShare;
- case "IPC":
- return ServiceName.NamedPipe;
- case "COMM":
- return ServiceName.SerialCommunicationsDevice;
- default:
- return ServiceName.AnyType;
- }
- }
- }
- }
|