mirror of
https://github.com/lionsoul2014/ip2region.git
synced 2025-12-08 19:25:22 +00:00
refactor: Search(uint) 方法标记过期
This commit is contained in:
parent
613501fc00
commit
0b3d794738
@ -30,6 +30,7 @@ public interface ISearcher
|
||||
/// 搜索方法 仅限 IPv4 使用
|
||||
/// </summary>
|
||||
/// <param name="ipAddress">IPv4 地址字节数组小端读取 uint 数值</param>
|
||||
[Obsolete("已弃用,请改用其他方法;Deprecated; please use Search(string) or Search(IPAddress) method.")]
|
||||
string? Search(uint ipAddress);
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -9,6 +9,7 @@ using IP2Region.Net.Abstractions;
|
||||
using IP2Region.Net.Internal;
|
||||
using IP2Region.Net.Internal.Abstractions;
|
||||
using System.Buffers.Binary;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
|
||||
@ -47,14 +48,13 @@ public class Searcher : ISearcher
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// </summary>
|
||||
public string? Search(IPAddress ipAddress)
|
||||
{
|
||||
return SearchCore(ipAddress.GetAddressBytes());
|
||||
}
|
||||
public string? Search(IPAddress ipAddress) => SearchCore(ipAddress.GetAddressBytes());
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// </summary>
|
||||
[Obsolete("已弃用,请改用其他方法;Deprecated; please use Search(string) or Search(IPAddress) method.")]
|
||||
[ExcludeFromCodeCoverage]
|
||||
public string? Search(uint ipAddress)
|
||||
{
|
||||
var bytes = BitConverter.GetBytes(ipAddress);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user