mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-07-14 13:25:03 +02:00
NetBiosUtils: Added GetSuffixFromMSNetBiosName method
This commit is contained in:
parent
aa2966a432
commit
28fa346b5b
1 changed files with 11 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
|
||||
/* Copyright (C) 2014-2020 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
|
||||
*
|
||||
* You can redistribute this program and/or modify it under the terms of
|
||||
* the GNU Lesser Public License as published by the Free Software Foundation,
|
||||
|
@ -44,6 +44,16 @@ namespace SMBLibrary.NetBios
|
|||
return netBiosName.TrimEnd(' ');
|
||||
}
|
||||
|
||||
public static NetBiosSuffix GetSuffixFromMSNetBiosName(string netBiosName)
|
||||
{
|
||||
if (netBiosName.Length != 16)
|
||||
{
|
||||
throw new ArgumentException("Invalid MS NetBIOS name");
|
||||
}
|
||||
|
||||
return (NetBiosSuffix)netBiosName[15];
|
||||
}
|
||||
|
||||
public static byte[] EncodeName(string name, NetBiosSuffix suffix, string scopeID)
|
||||
{
|
||||
string netBiosName = GetMSNetBiosName(name, suffix);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue