Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit59cfb1f

Browse files
committed
Use Convert.ToHexString.
1 parent9bc4e30 commit59cfb1f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

‎src/FirebirdSql.Data.FirebirdClient.Tests/FbDataReaderTests.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public async Task ReadBinaryTest()
313313
{
314314
bytes[i]=(byte)random.Next(byte.MinValue,byte.MaxValue);
315315
}
316-
varbinaryString=$"x'{BitConverter.ToString(bytes).Replace("-",string.Empty)}'";
316+
varbinaryString=$"x'{Convert.ToHexString(bytes)}'";
317317

318318
awaitusing(varcommand=newFbCommand($"select{binaryString} from TEST",Connection,transaction))
319319
{

‎src/FirebirdSql.Data.FirebirdClient/Common/Extensions.cs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ public static IntPtr ReadIntPtr(this BinaryReader self)
4848

4949
publicstaticstringToHexString(thisbyte[]b)
5050
{
51+
#ifNET5_0_OR_GREATER
52+
returnConvert.ToHexString(b);
53+
#else
5154
returnBitConverter.ToString(b).Replace("-",string.Empty);
55+
#endif
5256
}
5357

5458
publicstaticIEnumerable<IEnumerable<T>>Split<T>(thisT[]array,intsize)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp