{ "version": "https://jsonfeed.org/version/1", "title": "C#", "description": "", "home_page_url": "go/csharp", "feed_url": "feed/csharp.json", "icon": "https://cdn.v2ex.com/navatar/2387/337b/1005_large.png?m=1579006175", "favicon": "https://cdn.v2ex.com/navatar/2387/337b/1005_normal.png?m=1579006175", "items": [ { "author": { "url": "member/tiezlk443", "name": "tiezlk443", "avatar": "https://cdn.v2ex.com/avatar/7e33/af47/618150_large.png?m=1700142769" }, "url": "t/1170947", "title": "C#\u4e0a\u4f4d\u673a\u5f00\u53d1\u662f\u7528 winform \u90a3\u79cd\u4f20\u7edf\u5de5\u4e1a\u98ce\u8fd8\u662f WPF \u73b0\u4ee3\u98ce", "id": "t/1170947", "date_published": "2025-11-06T05:51:06+00:00", "content_html": "\u6709\u6ca1\u6709\u4e24\u4e2a\u5751\u90fd\u5446\u641e\u8fc7\u7684\u5927\u4f6c\u770b\u770b\u54ea\u79cd\u65b9\u5f0f\u597d\u4e00\u70b9,\u81ea\u5bb6\u7684\u5c0f\u9879\u76ee\u8f6f\u7532 plc \u53d8\u91cf\u4e0d\u591a" }, { "author": { "url": "member/shdm520", "name": "shdm520", "avatar": "https://cdn.v2ex.com/gravatar/25f6c729ae30207353f6bfcaa7fd9159?s=73&d=retro" }, "url": "t/1163402", "title": "paddleocr \u7684 C#\u96c6\u6210\u95ee\u9898", "id": "t/1163402", "date_published": "2025-10-05T04:18:09+00:00", "content_html": "

\u6839\u636e\u4e0b\u9762\u4e24\u4e2a\u6559\u7a0b\uff1a

\n
\n

\u6211\u53bb\u8bd5\u4e86\u4e00\u4e0b\uff0c\u7ed3\u679c\u4e00\u4e2a\u8981 paddleocr_sharp.dll \uff08 GPU \u63a8\u7406\u52a0\u901f\u8981\u6536\u8d39\uff09\uff0c\u4e00\u4e2a\u8981 ppocr.dll \uff08\u6559\u7a0b\u91cc\u8bf4\uff1a\u4ece\u5b98\u65b9 GitHub \u4ed3\u5e93\u4e0b\u8f7d\u9884\u7f16\u8bd1\u7684 Windows \u7248\u672c\uff08\u542b ppocr.dll \uff09\uff0c\u4f46\u662f release \u7684\u5305\u91cc\u6ca1\u6709\u8fd9\u4e2a dll \uff09

\n

\u5f04\u4e86\u4e00\u4e0a\u5348\u4e86\uff0c\u5feb\u653e\u5f03\u4e86\uff0c\u8fd8\u4e0d\u5982 python

\n

\u5e0c\u671b\u6709\u61c2\u8fd9\u65b9\u9762\u7684\u6765\u6307\u5bfc\u4e00\u4e0b\uff0c\u5c0f\u5f1f\u611f\u6069\u4e0d\u5c3d

\n" }, { "author": { "url": "member/jmliubiao", "name": "jmliubiao", "avatar": "https://cdn.v2ex.com/gravatar/2cf44ec8b4256b2a2e1b47be8c91b21e?s=73&d=retro" }, "url": "t/1162642", "title": "C#\u4e2d\u5f02\u6b65\u76f8\u5173\u7684\u95ee\u9898", "id": "t/1162642", "date_published": "2025-09-29T06:35:14+00:00", "content_html": "get1 \u548c get2 \u63a5\u53e3\u7684\u533a\u522b\u662f\u4e00\u4e2a\u52a0\u4e86 async \u3001await \u4e00\u4e2a\u6ca1\u52a0\u7684\u533a\u522b\uff0c\u52a0\u4e86 async \u3001await \u4f1a\u989d\u5916\u751f\u6210\u4e00\u4e9b\u72b6\u6001\u673a\u76f8\u5173\u7684\u4ee3\u7801\uff0c\u9664\u4e86\u8fd9\u4e2a\u533a\u522b\u8fd8\u6709\u5176\u4ed6\u533a\u522b\u5417\uff1f
\u6211\u7684\u7406\u89e3\u662f\uff0c\u5982\u679c\u4e0d\u9700\u8981\u83b7\u53d6\u5f02\u6b65\u540e\u7684\u7ed3\u679c\u8fdb\u884c\u5176\u4ed6\u5904\u7406\u5219\u53ef\u4ee5\u4e0d\u7528\u52a0\u3002\u5982\u679c\u4e0d\u52a0 async \u3001await \uff0c\u771f\u5230\u751f\u4ea7\u4e0a\u4f1a\u4e0d\u4f1a\u6709\u4ec0\u4e48\u95ee\u9898\uff1f

\u793a\u4f8b\u4ee3\u7801\uff1a
using Microsoft.AspNetCore.Mvc;

namespace WebApplication1.Controllers
{
[ApiController]
[Route(\"api/[controller]\")]
public class TestController : ControllerBase
{
[HttpGet(\"get1\")]
public Task<Student> Get1Async()
{
return new TsetService().Get1Async();
}
[HttpGet(\"get2\")]
public async Task<Student> Get2Async()
{
return await new TsetService().Get2Async();

}
}


public class TsetService
{

public Task<Student> Get1Async()
{
// \u6a21\u62df\u6570\u636e\u5e93\u67e5\u8be2
Task.Delay(100);
return Task.FromResult(new Student { Id = 1, Name = \"\u5f20\u4e09\" });
}

public async Task<Student> Get2Async()
{
// \u6a21\u62df\u6570\u636e\u5e93\u67e5\u8be2
await Task.Delay(100);
return new Student { Id = 1, Name = \"\u5f20\u4e09\" };
}
}

public class Student
{
public int Id { get; set; }
public string Name { get; set; }
}
}" }, { "author": { "url": "member/hez2010", "name": "hez2010", "avatar": "https://cdn.v2ex.com/gravatar/381b2bc7dec2504c148fd6cd9d0db10c?s=73&d=retro" }, "url": "t/1160063", "title": ".NET \u6362\u65b0\u7684\u5f02\u6b65\u7f16\u7a0b\u6a21\u578b\u4e86\uff0c\u6027\u80fd\u5f88\u5f3a", "id": "t/1160063", "date_published": "2025-09-17T17:44:01+00:00", "content_html": "

.NET \u73b0\u5728\u6b63\u5728\u628a async/await \u4ece\u539f\u6765\u7684\u7f16\u8bd1\u5668\u5b9e\u73b0\u6539\u6210 runtime \u76f4\u63a5\u652f\u6301\u65b0\u7684 async \u8c03\u7528\u7ea6\u5b9a\uff0c\u5e26\u6765\u4e86\u975e\u5e38\u5927\u7684\u6027\u80fd\u63d0\u5347\uff0c\u4e0d\u8fc7\u4ee3\u7801\u7684\u5199\u6cd5\u5012\u662f\u6ca1\u6709\u6539\u53d8\uff0c\u4f46\u5e95\u5c42\u6539\u53d8\u5f88\u5927\u3002

\n

\u5177\u4f53\u4ecb\u7ecd\u53ef\u4ee5\u53c2\u8003\uff1a\nhttps://zhuanlan.zhihu.com/p/1951804339745195151

\n" }, { "author": { "url": "member/ejin", "name": "ejin", "avatar": "https://cdn.v2ex.com/avatar/da68/8d46/29587_large.png?m=1756435283" }, "url": "t/1155537", "title": "\u60f3\u5ff5 C#", "id": "t/1155537", "date_published": "2025-08-28T06:51:28+00:00", "content_html": "

\u5fcd\u4e0d\u4f4f\u60f3\u8d77\u5b83

\n

\u60f3\u8d77\u5b83\u9aa8\u5b50\u91cc\u7684\u4f18\u96c5\u3001\u73b0\u4ee3\uff0c\u5374\u53c8\u52a1\u5b9e

\n

\u6211\u6b23\u8d4f\uff0c\u5e76\u4e14\u4f9d\u8d56

\n

\u5b83\u6709\u6e05\u6670\u7684\u5c42\u6b21\u611f\uff0c\u6bcf\u4e00\u4e2a\u7c7b\u578b\u90fd\u6709\u5176\u804c\u8d23\uff0c\u6bcf\u4e00\u6b21\u5f02\u6b65\u90fd\u6d41\u8f6c\u81ea\u5982

\n

\u5b83\u4e0d\u7ed9\u6211\u7e41\u7410\uff0c\u5374\u7ed9\u6211\u524d\u6240\u672a\u6709\u7684\u6548\u7387

\n

\u5b83\u7684\u4e16\u754c\u91cc\u6ca1\u6709\u8fb9\u754c\u7684\u675f\u7f1a\uff0c\u6ca1\u6709\u5e73\u53f0\u7684\u9694\u9602\uff0c\u53ea\u6709\u5c01\u88c5\u4e0b\u7684\u65e0\u9650\u53ef\u80fd

\n

\u5b83\u80fd\u5728\u4e0d\u5931\u771f\u7684\u524d\u63d0\u4e0b\u6f14\u8fdb\u51fa\u7cbe\u5f69\uff0c\u6258\u7ba1\u5982\u4e91\uff0c\u5374\u7a33\u5982\u6cf0\u5c71

\n

C# \uff0c\u6211\u60f3\u4f60\u4e86

\n" }, { "author": { "url": "member/hulalahei", "name": "hulalahei", "avatar": "https://cdn.v2ex.com/gravatar/3758ed7ebecf366cd0638a703a48e533?s=73&d=retro" }, "url": "t/1138099", "date_modified": "2025-06-13T05:25:09+00:00", "content_html": "

\u5f00\u53d1\u6846\u67b6\u662f Avaloina 11.2.2 + .NET 8.0 \uff0c\u5305\u662f System.IO.Ports 9.0.0-preview

\n

\u95ee\u9898\u63cf\u8ff0\uff1a\u7535\u8111\u901a\u8fc7\u4e32\u53e3\u8bfb\u53d6\u786c\u4ef6\u7684\u6570\u636e\uff0c\u8bbe\u5907\u4f1a\u8fde\u7eed\u4e0d\u65ad\u8fd4\u56de\u6570\u636e\uff0c\u5982\u679c\u8bbe\u5907\u6bcf\u79d2\u8fd4\u56de 50 \u6b21\u6570\u636e\uff0c\u8f6f\u4ef6\u5c31\u4e0d\u4f1a\u95ea\u9000\u3002\u5982\u679c\u8bbe\u5907\u8fd4\u56de\u6570\u636e\u7684\u901f\u5ea6\u8d85\u8fc7 200 \u6b21\u6bcf\u79d2\uff0c\u5c31\u6709\u4e00\u5b9a\u7684\u6982\u7387\u4f1a\u51fa\u73b0\u95ea\u9000\u7684\u95ee\u9898,\u95ea\u9000\u7684\u9891\u7387\u5927\u6982\u5c31\u662f 1-2 \u5c0f\u65f6\u51fa\u73b0\u4e00\u6b21\uff0c\u5076\u5c14\u4f1a 10 \u5206\u949f\u5185\u8fde\u7eed\u51fa\u73b0\u4e24\u6b21\u3002\u6211\u6362\u8fc7\u4e0d\u540c\u7684\u8bbe\u5907\uff0c\u53ea\u8981\u662f\u8bfb\u53d6\u901f\u5ea6\u8fc7\u5feb\uff0c\u90fd\u4f1a\u51fa\u73b0\u76f8\u540c\u7684\u95ee\u9898\u3002

\n

\u8bfb\u53d6\u6570\u636e\u7684\u4ee3\u7801\u7247\u6bb5\u662f\uff1a

\n
_serialPort = new SerialPort();\n_serialPort.Parity = Parity.None;\n_serialPort.DataBits = 8;\n_serialPort.StopBits = StopBits.One;\n_serialPort.RtsEnable = true;\n_serialPort.Handshake = Handshake.None;\n_serialPort.ReadTimeout = 5; \n_serialPort.WriteTimeout = 5;\n_serialPort.ReceivedBytesThreshold = 1;\n_serialPort.DataReceived += OnSerialDataReceived;\n\nprivate async void OnSerialDataReceived(object sender, SerialDataReceivedEventArgs e){\n var buffer = new byte[512]; // \u6700\u591a\u8bfb 10 \u5b57\u8282\n int numRead = await _serialPort.BaseStream.ReadAsync(buffer, 0, buffer.Length);\n}\n\n
\n

\u95ea\u9000\u7684\u65f6\u5019\u62a5\u9519\u4fe1\u606f\uff1a

\n
[06/02/2025 01:20:02] InvalidOperationException: Argument_NativeOverlappedAlreadyFree\n at System.Threading.ThreadPoolBoundHandle.OnNativeIOCompleted(IntPtr instance, IntPtr context, IntPtr overlappedPtr, UInt32 ioResult, UIntPtr numberOfBytesTransferred, IntPtr ioPtr)\n
\n

\u7b2c\u4e00\u4e2a\u5e2e\u52a9\u6211\u89e3\u51b3\u95ee\u9898\u7684\u5c0f\u4f19\u4f34\uff0c200 \u7ea2\u5305\u611f\u8c22\u3002

\n", "date_published": "2025-06-12T03:14:44+00:00", "title": "200 \u5757\u6709\u507f\u6c42\u52a9 C#\u9ad8\u901f\u8bfb\u53d6\u4e32\u53e3\uff0c\u5bfc\u81f4\u8f6f\u4ef6\u95ea\u9000\u7684\u95ee\u9898\u3002", "id": "t/1138099" }, { "author": { "url": "member/bunny189", "name": "bunny189", "avatar": "https://cdn.v2ex.com/gravatar/8f2759b68b20ddbba243c0c9a162f3d4?s=73&d=retro" }, "url": "t/1136103", "date_modified": "2025-06-03T09:32:55+00:00", "content_html": "\u73b0\u5728\u60f3\u5b66 C#\uff0c\u4f46\u662f\u611f\u89c9\u5b98\u65b9\u6587\u6863\u4e1c\u4e00\u70b9\u897f\u4e00\u70b9\u7684\uff0c\u611f\u89c9\u6709\u70b9\u6563
\u80fd\u4e0d\u80fd\u8bf7\u6559\u4e0b\u5927\u4f6c\u4eec\uff0cC#\u6bd4\u8f83\u597d\u7684\u5b66\u4e60\u8d44\u6599
\u6211\u8fd9\u8fb9\u4e3b\u8981\u60f3\u505a asp.net core

\u8c22\u8c22\uff01", "date_published": "2025-06-03T09:27:57+00:00", "title": "\u8001\u5e08\uff0c\u6211\u592a\u60f3\u8fdb\u6b65\u4e86\u2014\u2014\u5173\u4e8e C#\u5b66\u4e60", "id": "t/1136103" }, { "author": { "url": "member/xt666", "name": "xt666", "avatar": "https://cdn.v2ex.com/avatar/d05d/c14f/534037_large.png?m=1685523762" }, "url": "t/1124958", "title": "visual studio 2022 \u4ee3\u7801\u63d0\u793a\u6d88\u5931", "id": "t/1124958", "date_published": "2025-04-12T07:10:35+00:00", "content_html": "\u6c42\u52a9\u5404\u4f4d\ud83e\udef8\ud83c\udffb\ud83e\udef7\ud83c\udffb\uff0cvs2022 \u7684\u4e00\u4e9b\u529f\u80fd\uff0c\u6bd4\u5982\u4ee3\u7801\u8865\u5168\uff0c\u9ad8\u4eae\u663e\u793a\uff0c\u4e00\u4e9b\u4ee3\u7801\u4f1a\u53d8\u8272\uff0c\u6bd4\u5982\u53d8\u6210\u9ec4\u8272\uff0c\u8fd9\u4e9b\u529f\u80fd\u90fd\u6ca1\u4e86\uff0c\u5c0f\u767d\u53ea\u662f\u5076\u5c14\u7528\u4e00\u7528\uff0c\u4e0d\u77e5\u9053\u539f\u56e0\uff0c\u62dc\u6258\u5404\u4f4d\u4e86\u3002\u3002" }, { "author": { "url": "member/drymonfidelia", "name": "drymonfidelia", "avatar": "https://cdn.v2ex.com/gravatar/017bcef6e642dbf067e17838a9cd447a?s=73&d=retro" }, "url": "t/1106062", "date_modified": "2025-01-18T06:05:49+00:00", "content_html": "

\u6211\u8ba9\u5b83\u5224\u65ad\u8f93\u5165\u91cc\u53ea\u80fd\u6709\u5b57\u6bcd\u548c\u6570\u5b57\uff0c\u5176\u5b83\u8f93\u5165\u8981\u62e6\u622a

\n

\u7ed3\u679c\u4e0a\u751f\u4ea7\u73af\u5883\u540e\u7ecf\u5e38\u51fa\u73b0\u5947\u602a\u7684\u8f93\u5165\u5185\u5bb9\u6ca1\u62e6\u622a\u6389

\n
\"\u6d4b\u8bd5\".All(x=>char.IsLetterOrDigit(x)) \n
\n

\u6700\u540e\u53d1\u73b0\u539f\u56e0\u51fa\u5728 Cursor \u751f\u6210\u7684\u8fd9\u884c\u4ee3\u7801\u8f93\u5165\u4e2d\u6587\u7ed3\u679c\u5c45\u7136\u662f ture

\n

\u6df7\u5728\u4e00\u5806\u4ee3\u7801\u91cc\u9762\u5b8c\u5168\u60f3\u4e0d\u5230\u8fd9\u91cc\u80fd\u51fa\u95ee\u9898\uff0c\u6211\u624b\u5199\u7684\u8bdd\u6839\u672c\u4e0d\u77e5\u9053 C#\u6709\u8fd9\u4e2a\u51fd\u6570\u5c31\u4e0d\u4f1a\u51fa\u95ee\u9898

\n

C#\u8fd9\u8d77\u5f97\u5565\u540d\u592a\u5177\u8ff7\u60d1\u6027\u4e86\uff0c\u548c Python \u7684 rstrip \u4e00\u6837\uff0crstrip \u6211\u662f\u6ca1\u7528\u9519\u8fc7\uff0c\u4f46\u770b\u8fc7\u4e0d\u6b62\u4e00\u4e2a\u5f00\u6e90\u9879\u76ee\u91cc\u9762\u7528\u9519\u4e86

\n", "date_published": "2025-01-18T05:59:55+00:00", "title": "Cursor \u751f\u6210\u7684\u4ee3\u7801\u6709\u4e2a\u5927\u5751\uff0c\u6392\u67e5\u4e86\u4e00\u665a\u4e0a\u624d\u627e\u51fa\u539f\u56e0", "id": "t/1106062" }, { "author": { "url": "member/w568w", "name": "w568w", "avatar": "https://cdn.v2ex.com/gravatar/a07da489e1f63eaa83cded683786df23?s=73&d=retro" }, "url": "t/1102753", "date_modified": "2025-01-05T15:51:59+00:00", "content_html": "

\u4e4b\u524d\u4e45\u4ef0 C# \u5927\u540d\uff0c\u4f46\u4e00\u76f4\u6ca1\u5b9e\u9645\u63a5\u89e6\u8fc7\uff0c\u4e00\u662f\u611f\u89c9\u5fae\u8f6f\u7684\u4e1c\u897f\u90fd\u4e0d\u9760\u8c31\uff0c\u4e8c\u662f\u89c9\u5f97\u8fd9\u8bed\u8a00\u53ea\u6709\u6e38\u620f\u4ea7\u4e1a\u548c ASP.NET \u670d\u52a1\u5668\u5728\u7528\uff0c\u4e09\u662f\u4e0d\u77e5\u9053\u4ece\u54ea\u91cc\u7559\u4e0b\u4e86\u300c C# \u8fd0\u884c\u6027\u80fd\u7279\u522b\u5dee\u300d\u7684\u5370\u8c61\u3002

\n

\u4eca\u5929\u5728 Windows \u4e0a\u5199\u4e86\u4e2a\u5c0f\u6570\u636e\u5904\u7406\u811a\u672c\uff0c\u51fa\u4e8e\u597d\u5947\u53bb\u5b89\u88c5\u4e86\u4e00\u4e0b .NET 9 \uff0c\u7528 GPT \u628a Python \u8f6c\u6210\u4e86 C# \u53bb\u8dd1\uff0c\u53d1\u73b0\u8fd9\u4e1c\u897f\u8dd1\u8d77\u6765\u98de\u5feb\uff0c\u6bd4 Python \u5feb\u4e86\u4e0d\u6b62\u4e03\u516b\u500d\uff0cCPU \u4e5f\u5403\u6ee1\u4e86\u3002

\n

\u7ee7\u800c\u53bb\u67e5\u4e86\u4e00\u4e0b Debian \u7684 The Computer Language Benchmarks Game \u3002\u4e0d\u770b\u4e0d\u77e5\u9053\uff0c\u597d\u5bb6\u4f19\uff0c\u73b0\u5728 C# aot \u90fd\u80fd\u5728 CLBG \u6392\u5230 Go \u5934\u4e0a\u53bb\u4e86\uff1a

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Languageelapsed secs / fastest
Intel C1.1
C1.3
C# aot1.5
Java1.5
Go1.6

\u867d\u7136\u6027\u80fd\u6d4b\u8bd5\u548c Java \u5dee\u4e0d\u591a\uff0c\u4f46\u5185\u5b58\u5360\u7528\u8981\u5c11 50%~70%\u3002\u8bd5\u4e86\u4e00\u4e0b AOT \u7f16\u8bd1\uff0c\u7f16\u8bd1\u51fa\u6765\u5c31\u4e00\u4e2a 4~5MB \u53ef\u6267\u884c\u6587\u4ef6\uff0c\u4f53\u79ef\u5f88\u5c0f\u4e5f\u65e0\u4f9d\u8d56\uff0c\u989d\u5916\u5f00\u9500\u57fa\u672c\u548c Rust \u3001C++ \u90a3\u4e9b\u539f\u751f\u8bed\u8a00\u5dee\u4e0d\u591a\u65e0\u611f\u3002

\n

\u4f46\u8fd9\u53ef\u662f\u5e26 GC \u7684\u300c\u91cd\u578b\u300d\u8bed\u8a00\u554a\uff0c\u5fae\u8f6f\u8fd9\u51e0\u5e74\u7684\u4f18\u5316\u786e\u5b9e\u5389\u5bb3\u3002

\n

\u6240\u4ee5\u611f\u89c9\u8fd9\u8bed\u8a00\u633a\u6709\u610f\u601d\uff0c\u51c6\u5907\u6700\u8fd1\u591a\u82b1\u65f6\u95f4\u5f53\u5174\u8da3\u5b66\u4e60\u4e00\u4e0b\uff0c\u4f46\u8fd8\u662f\u5bf9\u5fae\u8f6f\u7684\u4e1c\u897f\u4e0d\u662f\u5f88\u653e\u5fc3\u3002\u95ee\u95ee\u5404\u4f4d C# \u5f00\u53d1\uff1aC# \u6709\u4ec0\u4e48\u7279\u522b\u660e\u663e\u7f3a\u70b9\u6216\u8005\u5199\u8d77\u6765\u5361\u624b\u7684\u5730\u65b9\u5417\uff1f \u63d0\u524d\u8c22\u8c22\u5927\u5bb6\u3002

\n", "date_published": "2025-01-05T15:51:22+00:00", "title": "C# \u6709\u54ea\u4e9b\u663e\u8457\u7684\u7f3a\u70b9\uff1f", "id": "t/1102753" }, { "author": { "url": "member/Shawn5", "name": "Shawn5", "avatar": "https://cdn.v2ex.com/avatar/8f9e/9131/246719_large.png?m=1503467140" }, "url": "t/1097321", "title": "\u6709\u6ca1\u6709 Sematic Kernel \u53ef\u4ee5\u843d\u5730\u7684\u5e94\u7528\u63a8\u8350\uff1f", "id": "t/1097321", "date_published": "2024-12-13T07:49:09+00:00", "content_html": "

\u5404\u4f4d\u5927\u4f6c\uff0c\u6709\u6ca1\u6709 Sematic Kernel \u53ef\u4ee5\u843d\u5730\uff0c\u53ef\u4ee5\u5e94\u7528\u7684\u9879\u76ee\u63a8\u8350\uff0c\u4e0d\u7528\u592a\u5927\uff0c\u5c0f\u9879\u76ee\u5373\u53ef\uff0c\u80fd\u591f\u8d5a\u70b9\u79c1\u623f\u94b1

\n" }, { "author": { "url": "member/irisdev", "name": "irisdev", "avatar": "https://cdn.v2ex.com/avatar/9b82/4dea/472891_large.png?m=1767662570" }, "url": "t/1097239", "title": "\u8bf7\u6559\u4e0b C#\u6709\u6ca1\u6709\u529e\u6cd5\u7528\u88c5\u9970\u5668\u5168\u5c40\u76d1\u63a7\u65b9\u6cd5\u6267\u884c\u65f6\u95f4", "id": "t/1097239", "date_published": "2024-12-13T03:32:04+00:00", "content_html": "\u73b0\u5728\u624b\u4e0a\u6709\u4e2a\u8001\u7684 mvc \u9879\u76ee\uff0c\u6709\u4e9b\u65b9\u6cd5\u6267\u884c\u65f6\u95f4\u6bd4\u8f83\u957f\uff0c\u6bcf\u6b21\u90fd\u662f\u4ee3\u7801\u7b2c\u4e00\u884c StopWatch \u76d1\u63a7\u4e00\u4e0b\u6267\u884c\u65f6\u95f4\u5199\u5165\u8868\u91cc\u9762\u76d1\u63a7\u4e0b\u3002\u4e0d\u77e5\u9053\u6709\u6ca1\u6709\u529e\u6cd5\u50cf python \u7684\u7c7b\u88c5\u9970\u5668\u51fd\u6570\u4e00\u6837\u5728\u7c7b\u6216\u65b9\u6cd5\u4e4b\u524d\u5199\u4e2a\u6ce8\u89e3\u5c31\u53ef\u4ee5\u76d1\u63a7\u6267\u884c\u65f6\u95f4\u7684\u65b9\u6848\uff0c.net \u7684 Attribute \u4f3c\u4e4e\u505a\u4e0d\u5230\u8fd9\u79cd\u8fd0\u884c\u65f6\u7684\u76d1\u63a7\u3002\u60f3\u4e86\u4e0b\u53ef\u80fd\u6709\u4e24\u4e2a\u65b9\u6848:

1.\u5199\u4e2a\u65b9\u6cd5\u4f20\u4e2a\u59d4\u6258\uff0c\u7136\u540e\u5728\u59d4\u6258\u6267\u884c\u524d\u540e\u6267\u884c\u4e00\u4e0b StopWatch \uff0c\u628a\u4e1a\u52a1\u4ee3\u7801\u90fd\u4f20\u5230\u8fd9\u4e2a\u59d4\u6258\u91cc\u3002\u4f46\u662f\u8fd9\u4e48\u505a\u5f88\u4e0d\u65b9\u4fbf\uff0c\u8c8c\u4f3c\u610f\u4e49\u4e0d\u5927

2..net \u6709\u4e2a\u5f00\u6e90\u5e93 MethodTime.Fody \uff0c\u52a0\u4e0a\u4e00\u4e2a[Time]\u7279\u6027\u5c31\u53ef\u4ee5\u5b9e\u73b0\u6211\u60f3\u8981\u7684\u6548\u679c\uff0c\u4f46\u662f\u5185\u7f51\u73af\u5883\uff0c\u800c\u4e14\u6211\u4e0d\u662f Leader \uff0c\u4e0d\u6562\u968f\u4fbf\u5f15\u5165\u5176\u4ed6\u5305

\u8bf7\u6559\u4e0b\u5404\u4f4d\u5927\u4f6c\u5728.net framework \u91cc\u9762\u6709\u6ca1\u6709\u9047\u5230\u8fc7\u7c7b\u4f3c\u7684\u9700\u6c42\uff0c\u6709\u6ca1\u6709\u4ec0\u4e48\u6bd4\u8f83\u597d\u7684\u5b9e\u73b0\u65b9\u6848\uff0c\u8c22\u8c22\u56de\u590d" }, { "author": { "url": "member/wangybsyuct", "name": "wangybsyuct", "avatar": "https://cdn.v2ex.com/avatar/ff1b/048a/601820_large.png?m=1736762708" }, "url": "t/1091681", "title": "\u60f3\u7528 c#\u7684 mvc \u5b9e\u73b0\u4e00\u4e2a\u529f\u80fd.", "id": "t/1091681", "date_published": "2024-11-22T01:14:37+00:00", "content_html": "

\u4e8b\u60c5\u662f\u8fd9\u6837\u7684\uff0c\u670d\u52a1\u5668\u6bd4\u8f83\u8001 windows server2003 \uff0c\u4e0a\u9762\u8fd0\u884c\u7684 php \u7248\u672c\u6709\u6f0f\u6d1e\uff0c\u4f46\u662f php \u65e0\u6cd5\u5347\u7ea7\uff0c\u64cd\u4f5c\u7cfb\u7edf\u66f4\u6362\u4e5f\u975e\u5e38\u56f0\u96be\u3002\n\u60f3\u4f7f\u7528 c#\u7684 MVC \u5b9e\u73b0\u91cc\u9762\u7684 php \u7a0b\u5e8f\u7684\u529f\u80fd\uff0c\u670d\u52a1\u5668\u662f\u63d0\u4f9b\u63a5\u53e3\uff0c\u63a5\u53e3\u5f62\u5f0f\u4e0d\u80fd\u53d8\u3002\n\u63a5\u53e3\u7c7b\u4f3c\u4e8e http://webserver.com/abc/def.php?code=abc123321\n\u6211\u60f3\u7528 c#\u7684 MVC \u5b9e\u73b0\u8fd9\u4e2a\u63a5\u53e3\uff0c\u8bf7\u6559\u5927\u5bb6 mvc \u7684\u7a0b\u5e8f\u548c\u914d\u7f6e\u8be5\u5982\u4f55\u5b9e\u73b0\uff1f\nmvc \u7684\u7a0b\u5e8f\u4e00\u4e9b\uff0c\u914d\u7f6e\u4e0d\u662f\u5f88\u719f\u3002\n\u611f\u8c22\u611f\u8c22

\n" }, { "author": { "url": "member/coolair", "name": "coolair", "avatar": "https://cdn.v2ex.com/avatar/c4fe/52ac/36118_large.png?m=1691894552" }, "url": "t/1085566", "date_modified": "2024-11-01T01:27:00+00:00", "content_html": "\u5b89\u88c5 Unity \u65f6\u5b89\u88c5\u7684 VS \uff0c\u53cc\u51fb\u811a\u672c\u4f1a\u81ea\u52a8\u6253\u5f00\u7f16\u8f91\uff0c\u4f46\u662f Unity \u81ea\u5e26\u7684\u7c7b\u3001\u65b9\u6cd5\uff0c\u90fd\u6ca1\u6709\u63d0\u793a\uff0c\u53ea\u80fd\u624b\u52a8\u6572\u2026\u2026", "date_published": "2024-11-01T01:19:23+00:00", "title": "Unity \u53cc\u51fb C#\u811a\u672c\u9ed8\u8ba4\u6253\u5f00 Visual Studio \u6ca1\u6709\u4ee3\u7801\u63d0\u793a\u5982\u4f55\u89e3\u51b3\uff1f", "id": "t/1085566" }, { "author": { "url": "member/newma", "name": "newma", "avatar": "https://cdn.v2ex.com/gravatar/04c5b5dff570c6569dcf46e70eda2558?s=73&d=retro" }, "url": "t/1082107", "title": "\u8bf7\u95ee c#\u6709\u6ca1\u6709\u4e00\u4e9b\u80fd\u89c4\u8303\u5b66\u4e60\u7684\u751f\u4ea7\u7ba1\u7406\u7cfb\u7edf\u5f00\u6e90\u9879\u76ee\uff1f", "id": "t/1082107", "date_published": "2024-10-21T02:58:13+00:00", "content_html": "

\u5c0f\u5f1f c++\u8f6c c#\uff0c\u90fd\u8bf4\u600e\u4e48\u7cfb\u7edf\u5b66\u90fd\u8981\u5b9e\u6218\uff0c\u60f3\u76f4\u63a5\u501f\u52a9\u4e00\u4e2a\u5b8c\u6574\u7684\u751f\u4ea7\u7ba1\u7406\u7cfb\u7edf\u7684\u5f00\u6e90\u9879\u76ee\u6765\u4e0a\u624b(\u6bd4\u8f83\u8d34\u5408\u5de5\u4f5c)\u3002\u5e0c\u671b\u4ee3\u7801\u548c\u6846\u67b6\u662f\u6bd4\u8f83\u89c4\u8303\u7684\uff0c\u524d\u540e\u7aef\u90fd\u6709\uff0c\u6269\u5c55\u6027\u5f3a\uff0c\u63d2\u4ef6\u6846\u67b6\u3002\n\u6536\u8d39\u7684\u9879\u76ee\u4e5f\u53ef\u4ee5\uff0c\u4e4b\u524d\u5728\u54b8\u9c7c\u4e70\u8fc7\u4e00\u4e2a\u4e0d\u77e5\u9053\u591a\u5c11\u624b\u7684\u7c7b\u4f3c\u7684\u7cfb\u7edf\uff0c\u4f46\u662f\u7248\u672c\u6709\u70b9\u4e45\u8fdc\u4e86\u3002

\n" }, { "author": { "url": "member/Lynntox", "name": "Lynntox", "avatar": "https://cdn.v2ex.com/gravatar/7e30f45e75096c30c9e1ca366c339232?s=73&d=retro" }, "url": "t/1070931", "date_modified": "2024-09-07T07:19:10+00:00", "content_html": "

\u6211\u4f7f\u7528 labview \u5199\u7684\u662f\u6ca1\u6709\u95ee\u9898\u7684\uff0c\u901a\u8fc7\u4e32\u53e3\u52a9\u624b\u53d1\u9001\u4ea7\u54c1\u4e5f\u6709\u53cd\u5e94

\n

\u4f46\u662f\u5728\u4f7f\u7528 C#\u5c31\u6ca1\u529e\u6cd5\u6b63\u5e38\u901a\u8baf

\n

\u9996\u5148 \u6211\u786e\u8ba4\u4e86\u7ebf\u662f\u6ca1\u95ee\u9898\u7684\uff0c\u4e32\u53e3\u5c5e\u6027\u662f\u6ca1\u95ee\u9898\u7684 9600-8-n-1

\n

byte[] command = new byte[]\n{\n0xAA, 0x55, 0x12, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEE\n};

\n

// \u53d1\u9001\u6570\u636e\nserialPort.Write(command, 0, command.Length);

\n

\u5c31\u5f88\u5947\u602a

\n", "date_published": "2024-09-07T07:09:31+00:00", "title": "C#\u4e32\u53e3\u901a\u4fe1\u95ee\u9898 \u6c42\u6559", "id": "t/1070931" }, { "author": { "url": "member/yuaotian", "name": "yuaotian", "avatar": "https://cdn.v2ex.com/avatar/3790/6ab3/441618_large.png?m=1768200763" }, "url": "t/1065009", "title": "C# \u600e\u4e48\u540c\u65f6\u4ea4\u53c9\u7f16\u8bd1 windows Linux mac \uff1f\u8ddf go \u4e00\u6837", "id": "t/1065009", "date_published": "2024-08-14T10:37:36+00:00", "content_html": "

\u597d\u5947\uff0c\u600e\u4e48\u540c\u65f6\u7f16\u8bd1\u4e09\u4e2a\u7cfb\u7edf\u7684\u6267\u884c\u6587\u4ef6\uff1f go \u5c31\u53ef\u4ee5\uff0cC#\u5728\u53d1\u5e03\u91cc\u9762\u6ca1\u627e\u5230\uff0c\u641c\u7d22\u5f15\u64ce\u8d44\u6599\u4e5f\u5f88\u5c11\uff0c\u8ddf\u7740\u7f16\u8bd1\u4e5f\u4e0d\u884c\u3002

\n

\u5f00\u53d1\uff1avs2022 \u3001Rider

\n" }, { "author": { "url": "member/drymonfidelia", "name": "drymonfidelia", "avatar": "https://cdn.v2ex.com/gravatar/017bcef6e642dbf067e17838a9cd447a?s=73&d=retro" }, "url": "t/1064736", "title": "ClosedXML \u5982\u4f55\u5bf9\u4e00\u5217\u6570\u636e\u8bbe\u7f6e\u9ad8\u4eae\u91cd\u590d\u9879\uff1f\uff08\u9ad8\u4eae\u91cd\u590d\u9879\u662f Excel \u7684\u4e00\u79cd\u529f\u80fd\uff1b\u4e0d\u80fd\u624b\u52a8\u7ed9\u91cd\u590d\u5355\u5143\u683c\u8bbe\u7f6e\u80cc\u666f\u989c\u8272\uff0c\u8fd9\u6837\u7684\u8bdd\u7528\u6237\u5220\u9664\u91cd\u590d\u9879\u540e\u4e0d\u4f1a\u81ea\u52a8\u53bb\u9664\u9ad8\u4eae\uff09", "id": "t/1064736", "date_published": "2024-08-13T13:54:27+00:00", "content_html": "" }, { "author": { "url": "member/huzhikuizainali", "name": "huzhikuizainali", "avatar": "https://cdn.v2ex.com/avatar/1869/a390/522912_large.png?m=1752498684" }, "url": "t/1053917", "title": "\u6c42\u63a8\u8350\u8f6f\u4ef6\u5f00\u53d1\u7ec3\u4e60\u9879\u76ee\u7684\u6559\u5b66\u89c6\u9891\u6216\u4e66\u7c4d", "id": "t/1053917", "date_published": "2024-07-01T05:40:52+00:00", "content_html": "

\"pkcIXjg.png\"

\n" }, { "author": { "url": "member/huzhikuizainali", "name": "huzhikuizainali", "avatar": "https://cdn.v2ex.com/avatar/1869/a390/522912_large.png?m=1752498684" }, "url": "t/1051500", "title": "\u5982\u4f55\u5728 visual studio 2022 \u4e2d\u65b0\u5efa\u5355\u5143\u6d4b\u8bd5\u9879\u76ee\u65f6\u9ed8\u8ba4\u4f7f\u7528\u6700\u65b0\u7248\u672c\uff1f", "id": "t/1051500", "date_published": "2024-06-21T07:09:25+00:00", "content_html": "

\u6211\u901a\u8fc7 visual studio 2022 \u6dfb\u52a0\u4e00\u4e2a Nunit \u9879\u76ee\u3002\u6dfb\u52a0\u4ee5\u540e\u6211\u53d1\u73b0\u5176\u4e2d\u4f9d\u8d56\u7684 Nunit \u7248\u672c\u662f 3.14.0 \u3002\u4f46\u662f Nunit \u76ee\u524d\u6700\u65b0\u7248\u662f 4.1.0 \u3002\u6211\u5982\u4f55\u8ba9\u4ee5\u540e\u6240\u6709\u7684\u65b0\u5efa Nunit \u9879\u76ee\u9ed8\u8ba4\u5c31\u4f7f\u7528 4.1.0 \u7248\u3002\u800c\u4e0d\u4f7f\u7528 3.14.0 \u7248\uff1f

\n

\u4ee5\u4e0a\u53ea\u662f\u4e00\u4e2a\u4f8b\u5b50\u3002\u5176\u5b9e\u7528 visual studio \u65b0\u5efa\u4efb\u4f55\u6709\u4f9d\u8d56\u9879\u7684\u9879\u76ee\u65f6\u90fd\u4f1a\u9762\u4e34\u8fd9\u4e2a\u95ee\u9898\u3002

\n

GPT \u8ba9\u6211\u7528 nuget \u5bf9\u6bcf\u4e2a\u9879\u76ee\u6307\u5b9a\u76f8\u5e94\u7248\u672c\u7684\u5305\u3002\u4f46\u662f\u5f53\u9879\u76ee\u5f88\u591a\u7684\u65f6\u5019\u4f1a\u6709\u5927\u91cf\u91cd\u590d\u7684\u5de5\u4f5c\u3002

\n" }, { "author": { "url": "member/xmagicer", "name": "xmagicer", "avatar": "https://cdn.v2ex.com/avatar/5555/a8a2/547090_large.png?m=1775927281" }, "url": "t/1041885", "title": "C#\u6709\u50cf C++\u7684 libevent \u540c\u6837\u5b9a\u4f4d\u7684\u9ad8\u6027\u80fd\u8de8\u5e73\u53f0\u7f51\u7edc\u5e93\u5417\uff1f", "id": "t/1041885", "date_published": "2024-05-18T11:18:28+00:00", "content_html": "" }, { "author": { "url": "member/Abyss0729", "name": "Abyss0729", "avatar": "https://cdn.v2ex.com/gravatar/2821f5ccf515bb3bacc434917d59c550?s=73&d=retro" }, "url": "t/1039458", "title": "\u6c42\u52a9\uff0c\u5982\u4f55\u6b63\u78ba\u52ab\u6301\u7cfb\u7d71 DLL \u8abf\u7528", "id": "t/1039458", "date_published": "2024-05-10T06:04:37+00:00", "content_html": "

\u80cc\u666f\uff1a\u516c\u53f8\u96fb\u8166\u4e2d\u6709\u500b\u4f7f\u7528 C#\u7de8\u5beb\u7684\u96fb\u8166\u76e3\u63a7\u8edf\u4ef6\uff0c\u5176\u4e2d\u6709\u4e00\u500b\u529f\u80fd\u5c31\u662f\u6aa2\u67e5\u6b63\u5728\u904b\u884c\u7684\u9032\u7a0b\uff0c\u4e26\u7372\u53d6\u6240\u6709\u9032\u7a0b\u7684 EXE \u7684\u8cc7\u6e90\u4fe1\u606f\uff08\u7522\u54c1\u540d\u7a31\uff0c\u516c\u53f8\u7b49\u7b49\uff09\uff0c\u4f9d\u6b64\u4f86\u78ba\u5b9a\u662f\u5426\u662f\u9055\u7981\u8edf\u4ef6\u3002\n\u7d93\u904e\u53cd\u7de8\u8b6f\u5f97\u77e5\u5b83\u4f7f\u7528\u7684\u662f System.Diagnostics.FileVersionInfo.GetVersionInfo \u4f86\u7372\u53d6\u7684\u4fe1\u606f\u3002\n\u8acb\u554f\u5982\u4f55\u8b93\u9019\u500b\u529f\u80fd\u7121\u6548\u3002\n\u6211\u5617\u8a66\u4fee\u6539\u4e86 System.Diagnostics.FileVersionInfo.dll \u4e26\u653e\u5230 EXE \u6587\u4ef6\u76ee\u9304\u5167\u4f46\u662f\u6c92\u6709\u6548\u679c\u3002\n\u81ea\u5df1\u6c92\u5b78\u904e C#\uff0c\u8acb\u5404\u4f4d\u8cdc\u6559\uff01

\n" }, { "author": { "url": "member/289396212", "name": "289396212", "avatar": "https://cdn.v2ex.com/gravatar/9102c9a79751e53a01fb4f460c0d8bc1?s=73&d=retro" }, "url": "t/1003509", "date_modified": "2023-12-28T00:12:47+00:00", "content_html": "\u5e73\u65f6\u63a5\u6d3b\u7684\u65f6\u5019\u80fd\u5feb\u901f\u51fa\u6d3b\u7684\u90a3\u79cd", "date_published": "2023-12-26T06:32:46+00:00", "title": "C#\u751f\u6001\u91cc\u6709\u5565\u7b80\u5355\u4e00\u70b9\u7684\u5bb9\u6613\u4e0a\u624b\u7684\u5f00\u6e90\u540e\u53f0\u7ba1\u7406\u7cfb\u7edf\u5417\uff1f", "id": "t/1003509" }, { "author": { "url": "member/xiamo23", "name": "xiamo23", "avatar": "https://cdn.v2ex.com/gravatar/7d53ce0cc5918f7b4492a575784900b7?s=73&d=retro" }, "url": "t/1003381", "title": ".NET6 HttpClient \u65e0\u53cd\u5e94\u4e5f\u4e0d\u8d85\u65f6\uff1f", "id": "t/1003381", "date_published": "2023-12-25T15:20:33+00:00", "content_html": "

\u8fd9\u4e2a\u4ee3\u7801\u54ea\u91cc\u6709\u95ee\u9898\u5417\uff1f\u8bf7\u6c42\u540e\u4e00\u76f4\u65e0\u53cd\u5e94\uff0c\u4e5f\u4e0d\u4f1a\u62a5\u8d85\u65f6\uff0c\u4f46\u662f\u6293\u5305\u8f6f\u4ef6\u5df2\u7ecf\u770b\u5230\u6b63\u5e38\u8bf7\u6c42\u548c\u8fd4\u56de\u4e86\uff1f\u662f\u4e0d\u662f HOST \u548c\u8bf7\u6c42 URI \u4e0d\u4e00\u76f4\u7684\u95ee\u9898\u300b\uff1f\uff1f\n\nvar handler = new HttpClientHandler\n{\nAllowAutoRedirect = false,\nCookieCOntainer= new CookieContainer(),\nUseCookies = true,\nUseProxy = true,\nProxy = new WebProxy(\"http://127.0.0.1:8888\", false),\nServerCertificateCustomValidatiOnCallback= (message, cert, chain, errors) => { return true; },\nMaxAutomaticRedirectiOns= 1,

\n

};\nusing HttpClient webclient = new(handler);\nwebclient.DefaultRequestVersion = HttpVersion.Version20;\nwebclient.Timeout = TimeSpan.FromSeconds(10);

\n

webclient.DefaultRequestHeaders.Host = urls[1];\nwebclient.DefaultRequestHeaders.TryAddWithoutValidation(\"User-Agent\", ua(mobile));\nwebclient.DefaultRequestHeaders.TryAddWithoutValidation(\"x-requested-with\", \"com.ct.client\");\nwebclient.DefaultRequestHeaders.TryAddWithoutValidation(\"upgrade-insecure-requests\", \"1\");\nHttpResponseMessage respOnse= await webclient.GetAsync(urls[0]);\n\n\u7136\u540e\u5c31\u4e00\u76f4\u6ca1\u53cd\u5e94\u4e86

\n
" }, { "author": { "url": "member/xiamo23", "name": "xiamo23", "avatar": "https://cdn.v2ex.com/gravatar/7d53ce0cc5918f7b4492a575784900b7?s=73&d=retro" }, "url": "t/1003023", "title": "\u5173\u4e8e.NET6 httpclient \u7528 IPV6 \u8fd8\u662f IPV4 \u7684\u7591\u95ee", "id": "t/1003023", "date_published": "2023-12-24T10:31:53+00:00", "content_html": "

\u5404\u4f4d\uff1f\u5047\u5982\u6211\u9700\u8981\u53ea\u901a\u8fc7 IPV4 \u8bbf\u95ee\u9700\u8981\u600e\u4e48\u5b9e\u73b0\uff1f\n\u7531\u4e8e\u4e2a\u522b\u539f\u56e0\uff0c\u6709\u4e9b\u670d\u52a1\u9700\u8981\u901a\u8fc7 IPV6 \u8bbf\u95ee\uff0c\u800c\u6709\u4e9b\u53c8\u53ea\u80fd IPV4\n\u534f\u8bae\u4e0d\u5bf9\u5c31\u4f1a\u62a5\u9519\uff0chttpclient \u9700\u8981\u600e\u4e48\u8bbe\u7f6e\uff1f

\n" }, { "author": { "url": "member/justdoitzZ", "name": "justdoitzZ", "avatar": "https://cdn.v2ex.com/avatar/7488/2140/500944_large.png?m=1765769522" }, "url": "t/1002885", "date_modified": "2023-12-23T10:00:37+00:00", "content_html": "

\u624b\u5934\u6709\u4e2a\u6587\u4ef6\u683c\u5f0f\u8f6c\u6362\u7684 DLL \uff0c\u6b63\u5e38\u4e00\u4e2a\u6587\u4ef6\u683c\u5f0f\u8f6c\u6362\u9700\u8981 0.4s

\n

\u9996\u5148\u505a\u4e86\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\uff0c\u8bfb\u53d6\u4e86\u76ee\u5f55\u4e0b\u7684 100 \u4e2a\u9700\u8981\u8f6c\u6362\u7684\u6587\u4ef6\u7684\u8def\u5f84\u4fe1\u606f\uff0c\u7136\u540e 100 \u4e2a\u4f9d\u6b21\u8fdb\u884c\u8f6c\u6362\uff0c\u8017\u65f6 0.4* 100\n= 40s

\n

\u7136\u540e\u6211\u628a\u8fd9\u4e2a\u5c0f\u7a0b\u5e8f\u590d\u5236\u4e86\u4e00\u4e2a\uff0c\u6210\u4e86\u5c0f\u7a0b\u5e8f 2.

\n

\u5c0f\u7a0b\u5e8f\u548c\u5c0f\u7a0b\u5e8f 2 \u53ef\u4ee5\u540c\u65f6\u53cc\u5f00\uff0c\u8fdb\u884c\u6587\u4ef6\u8f6c\u6362\u3002\u901f\u5ea6\u4e5f\u52a0\u5feb\u4e86\u3002

\n

\u4f46\u662f\u5f53\u6211\u5c1d\u8bd5\u5728\u4e00\u4e2a\u7a0b\u5e8f\u91cc\u9762\u4f7f\u7528 task \u6216\u8005\u591a\u7ebf\u7a0b\u8c03\u7528 DLL \u91cc\u9762\u7684\u6587\u4ef6\u8f6c\u6362\u51fd\u6570\u7684\u65f6\u5019\uff0c\u5c31\u62a5\u9519\u4e86\u3002DLL \u5185\u7f6e\u4e86\u52a0\u5bc6\u72d7\u6743\u9650\u67e5\u9605\u529f\u80fd\uff0c\u6b64\u65f6\u5c31\u5f02\u5e38\u4e86\u3002\u4f46\u662f\u5f88\u5947\u602a\u7684\u662f\uff0c\u5c0f\u7a0b\u5e8f 1 \u548c\u5c0f\u7a0b\u5e8f 2 \u53ef\u4ee5\u540c\u65f6\u8fd0\u884c\uff0c\u6ca1\u6709\u51fa\u73b0\u673a\u5bc6\u72d7\u6743\u9650\u7684\u95ee\u9898\u3002

\n

\u56f0\u6270\u6211\u597d\u4e45\u7684\u95ee\u9898\uff0c\u6709\u5927\u4f6c\u53ef\u4ee5\u89e3\u7b54\u7591\u60d1\u5417\uff1f

\n", "date_published": "2023-12-23T09:56:13+00:00", "title": "\u5173\u4e8e C#\u8c03\u7528 DLL \u7684\u7591\u60d1", "id": "t/1002885" }, { "author": { "url": "member/idragonet", "name": "idragonet", "avatar": "https://cdn.v2ex.com/avatar/3acd/5809/429891_large.png?m=1716195208" }, "url": "t/1002476", "date_modified": "2023-12-24T23:50:56+00:00", "content_html": "

\u5728\u8c08\u4e00\u4e2a\u5916\u5feb\u5355\uff0c\u9875\u9762\u57fa\u672c\u90fd\u662f\u589e\u5220\u6539\u67e5\u529f\u80fd\uff0c\u90fd\u662f\u624b\u673a\u9875\u9762.

\n", "date_published": "2023-12-21T23:52:09+00:00", "title": "C#\u7a0b\u5e8f\u5458\u5f00\u53d1\u624b\u673a\u9875\u9762\u6709\u4ec0\u4e48\u9002\u5408\u7684 UI \u6846\u67b6\uff1f", "id": "t/1002476" }, { "author": { "url": "member/crazylinus", "name": "crazylinus", "avatar": "https://cdn.v2ex.com/avatar/bcc1/810b/124275_large.png?m=1647830341" }, "url": "t/1001110", "date_modified": "2023-12-17T13:41:56+00:00", "content_html": "\u6709\u6ca1\u6709\u76f8\u5173\u7684\u5e93\uff1f\u8c22\u8c22\u4e86\u3002", "date_published": "2023-12-17T09:18:14+00:00", "title": "\u6c42\u6559\u5927\u4f6c\uff0c\u7528 C#\u5982\u4f55\u64cd\u4f5c word \u6587\u6863", "id": "t/1001110" }, { "author": { "url": "member/huzhikuizainali", "name": "huzhikuizainali", "avatar": "https://cdn.v2ex.com/avatar/1869/a390/522912_large.png?m=1752498684" }, "url": "t/998864", "title": "\u5982\u4f55\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u624d\u80fd\u8ba9 dotnet \u548c ipconfig \u90fd\u53ef\u4ee5\u5de5\u4f5c\uff1f", "id": "t/998864", "date_published": "2023-12-08T17:46:10+00:00", "content_html": "\u4e8b\u60c5\u7684\u8d77\u56e0\u662f\u8fd9\u6837\u7684\u3002\u4eca\u5929\u6211\u5728 CMD \u4e2d\u7a81\u7136\u53d1\u73b0 ipconfig \u547d\u4ee4\u6ca1\u6cd5\u7528\u4e86\u3002\u7f51\u4e0a\u67e5\u4e86\u4e00\u4e0b\uff0c\u6309\u7167\u6307\u5f15\uff0c\u5c06\u73af\u5883\u53d8\u91cf\u4e2d path \u914d\u5236\u6210 windows\u2192System32 \u8def\u5f84\u4e0b\u3002\u518d\u6b21\u56de\u5230 CMD \uff0c\u53d1\u73b0 ipconfig \u547d\u4ee4\u53ef\u7528\u4e86\uff01

\u4f46\u662f\u518d\u8c03\u8bd5\u7a0b\u5e8f\u53d1\u73b0.NET \u7528\u4e0d\u4e86\u3002 \u53d1\u73b0 dotnet \u547d\u4ee4\u4e0d\u53ef\u7528\u4e86\u3002\u663e\u7136\u662f\u56e0\u4e3a\u73af\u5883\u53d8\u91cf\u6539\u53d8\u4e86\u3002\u518d\u6b21\u67e5\u65b9\u6cd5\u3002\u5c06 path \u8def\u5f84\uff0c\u6539\u4e3a dotnet \u6240\u5728\u76ee\u5f55\u3002\u95ee\u9898\u89e3\u51b3\u4e86\u3002\u4f46\u662f ipconfig \u547d\u4ee4\u53c8\u4e0d\u53ef\u7528\u4e86\uff08\u6211\u77e5\u9053 cd \u5230 windows\u2192System32 \u76ee\u5f55\u4e0b ipconfig \u547d\u4ee4\u8fd8\u662f\u53ef\u7528\u7684\uff09\u3002

\u8fd9\u6837\u611f\u89c9\u5f88\u4e0d\u65b9\u4fbf\uff0c\u8bf7\u95ee\u6709\u6ca1\u6709\u4ec0\u4e48\u529e\u6cd5\u8ba9.NET \u548c ipconfig \u547d\u4ee4\u540c\u65f6\u53ef\u7528\uff1f" }, { "author": { "url": "member/zhoufan47", "name": "zhoufan47", "avatar": "https://cdn.v2ex.com/gravatar/fa322bbd5f1d1a8a7ecc6aac84d3933f?s=73&d=retro" }, "url": "t/995271", "title": "C#\u7684\u4e8c\u7ef4\u7801\u6446\u6e21\u89e3\u7801\u9047\u5230\u70b9\u95ee\u9898", "id": "t/995271", "date_published": "2023-11-26T05:24:11+00:00", "content_html": "

\u4e4b\u524d\u5728\u7f51\u4e0a\u627e\u5230\u4e2a python \u5199\u7684\u4e8c\u7ef4\u7801\u6446\u6e21\u7a0b\u5e8f\uff0c\u8bc6\u522b\u7387\u9887\u9ad8\uff0c\u4f46\u662f python \u7684 UI \u754c\u9762\u5b9e\u5728\u96be\u753b\uff0c\u81ea\u5df1\u5bf9 python \u4e5f\u4e0d\u662f\u5f88\u719f\u6089\u3002\n\u6700\u8fd1\u7528 C#\u91cd\u5199\u4e86\u4e00\u4efd\uff0c\u53ef\u4ee5\u5b9e\u73b0\u4e00\u4e9b\u7279\u5b9a\u529f\u80fd\uff0c\u4f46\u662f\u53d1\u73b0\u65e0\u8bba\u662f ZXing.net \u8fd8\u662f Zbar \uff0c\u8bc6\u522b\u6548\u7387\u548c\u6210\u529f\u7387\u5bf9\u6bd4\u4e4b\u524d python \u7528\u7684 CV2 \u6253\u5f00\u6444\u50cf\u5934+pyzbar \u8bc6\u522b\u4e8c\u7ef4\u7801\u7684\u7ec4\u5408\u5dee\u5f88\u591a\u5f88\u591a\u3002\npython \u4e0b\u6211\u662f\u91c7\u7528\u56fa\u5b9a 10ms \u8bfb\u53d6\u6444\u50cf\u5934\u8bc6\u522b\u4e00\u6b21\uff0c\u5355\u6b21 6 \u56fe\uff0c\u6548\u7387\u5927\u7ea6\u662f 60/s \u3002\nc#\u4e0b\u6211\u662f\u91c7\u7528\u7ed1\u5b9a timer \u7684\u5f62\u5f0f\uff0c20ms \u89e6\u53d1\u4e00\u6b21\u4ece\u6444\u50cf\u5934\u83b7\u53d6 bitmap \uff0c\u9001\u8fdb decoder \u89e3\u7801\uff0c\u6548\u7387\u53ea\u6709 1/S \uff0c\u751a\u81f3\u7ecf\u5e38\u8bc6\u522b\u4e0d\u51fa\u3002\n\u5404\u4f4d\u5927\u4f6c\u5e2e\u5fd9\u770b\u770b\u3002\nC#\u6838\u5fc3\u4ee3\u7801

\n
\n
 private void decodeCurrentFrame()\n
\n
\n
 {\n if (graphics == null)\n {\n return;\n }\n //\u590d\u5236\u56fe\u50cf\n this.graphics.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, new Size(width, height), CopyPixelOperation.SourceCopy);\n this.pictureBox1.Image = this.bitmapSrc;\n Stopwatch sw = new Stopwatch();\n sw.Start();\n Bitmap bitmap = (Bitmap)this.bitmapSrc.Clone();\n //\u89e3\u7801\u56fe\u7247\n Result[] results = reader.DecodeMultiple(bitmap);\n //\u8bfb\u53d6\u8bc6\u522b\u51fa\u6765\u7684\u4e8c\u7ef4\u7801\n if (results != null)\n {\n foreach (Result result in results)\n {\n {\n Console.WriteLine(\"\u6210\u529f\u8bc6\u522b\");\n string cOntent= result.ToString();\n if (content.Length <= 20)\n {\n return;\n }\n string prefix = content.Substring(0, 16); //\u83b7\u53d6\u6587\u4ef6\u524d\u7f00\n string currentIndex = prefix.Substring(0, 8); //\u83b7\u53d6\u5f53\u524d\u5207\u7247\u7d22\u5f15\u7f16\u53f7\n string total = prefix.Substring(8); //\u83b7\u53d6\u603b\u7d22\u5f15\u6570\n if (content.Contains(\"|\"))\n {\n int prefixIndex = content.LastIndexOf(\"|\");\n int qrCurrentIndex = content.IndexOf(\"|\");\n currentIndex = content.Substring(0, qrCurrentIndex);\n string raw = content.Substring(prefixIndex + 1);\n cOntent= \"0000000000000000\" + raw;\n Console.WriteLine(\"\u65e7\u7248\u6570\u636e\" + raw + \"\u7d22\u5f15\u7f16\u53f7\uff1a\" + currentIndex);\n }\n initResultMap(total);\n dealData(currentIndex, content.Substring(16));\n checkResultMap();\n }\n }\n }\n //\u7edf\u8ba1\u6570\u636e\n sw.Stop();\n TimeSpan ts = sw.Elapsed;\n string costed = ts.TotalMilliseconds + \"ms\";\n labelTickCost.Text = costed;\n }\n \n
\n

pyhon \u6838\u5fc3\u4ee3\u7801

\n
\n
 def decodeDisplay(img):\n
\n
\n
 global number\n barcodes = pyzbar.decode(img)\n for barcode in barcodes:\n barcodeData = barcode.data.decode()\n try:\n i = int(barcodeData[:8])\n except ValueError:\n return img\n try:\n max = int(barcodeData[8:16])\n except ValueError:\n return img\n ll = ''\n\n if not os.path.exists(\"temp/result\" + str(i) + \".txt\"):\n barcodeData = barcodeData[16:]\n with open(\"temp/result\" + str(i) + \".txt\", \"w+\") as f:\n f.write(barcodeData)\n number = number + 1\n global sat\n if number == max:\n filecount = len(os.listdir('temp/result'))\n if number != filecount:\n number = filecount\n continue\n j = 1\n while j <= number:\n with open(\"temp/result\" + str(j) + \".txt\", \"r+\") as f:\n txt = f.read()\n ll = ll + txt\n j = j + 1\n global starttime\n ent = time.time()\n theLB.insert(END, \"\u8bc6\u522b\u7ed3\u675f\")\n theLB.see(END)\n with open(\"result/b64.txt\", \"w\") as f:\n f.write(ll)\n temp = base64.b64decode(ll)\n with open(\"result/result.txt\", \"wb\") as f:\n f.write(temp)\n if tkinter.messagebox.askyesno(title='\u8bc6\u522b\u6210\u529f', message='\u53e6\u5b58\u4e3a'):\n old_path = tk.filedialog.askdirectory()\n shutil.copy(\"result/result.txt\", old_path)\n theLB.insert(END, \"\u8bc6\u522b\u6210\u529f\")\n del_file()\n return img\n
\n" }, { "author": { "url": "member/bsg1992", "name": "bsg1992", "avatar": "https://cdn.v2ex.com/gravatar/c327dab8a09f9c5c5d4016a1099fd5e1?s=73&d=retro" }, "url": "t/994968", "title": "\u8bf7\u6559\u4e00\u4e2a sha256withecdsa \u7b7e\u540d\u7684\u95ee\u9898", "id": "t/994968", "date_published": "2023-11-24T14:05:42+00:00", "content_html": "

\u5bf9\u63a5\u4e00\u4e2a java \u7cfb\u7edf \u5bf9\u65b9\u4f7f\u7528 sha256withecdsa \u8fdb\u884c\u7b7e\u540d\u8ba4\u8bc1
\n\u6211\u8fd9\u91cc\u4f7f\u7528\u7684\u662f dotnet framework \u7528\u4e86 BouncyCastle \u8fd9\u4e2a\u5e93\uff0c\u4f46\u662f\u751f\u6210\u7684\u7b7e\u540d\u548c java \u4e0d\u4e00\u81f4
\n\u5948\u4f55\u7f51\u4e0a\u7684\u76f8\u5173\u8d44\u6599\u5b9e\u5728\u592a\u5c11\uff0c\u6c42\u6559\u4e00\u4e0b\u4e07\u80fd\u7684 v \u53cb\u3002

\n" }, { "author": { "url": "member/huzhikuizainali", "name": "huzhikuizainali", "avatar": "https://cdn.v2ex.com/avatar/1869/a390/522912_large.png?m=1752498684" }, "url": "t/993166", "title": "C#\u4e2d\u6709\u4ec0\u4e48\u4e13\u6709\u540d\u8bcd\u6765\u5b9a\u4e49 \u65b9\u6cd5.\u65b9\u6cd5 \u8fd9\u79cd\u8c03\u7528\u65b9\u5f0f\u4e48\uff1f", "id": "t/993166", "date_published": "2023-11-19T01:41:44+00:00", "content_html": "C#\u4e2d\u53ef\u4ee5\u7528:
\u5bf9\u8c61\u540d.\u65b9\u6cd5
\u7c7b\u540d.\u65b9\u6cd5
this.\u65b9\u6cd5

\u8bf7\u770b\u4e0b\u9762\u8fd9\u6bb5\u4ee3\u7801\uff0cGetManager \u662f\u65b9\u6cd5\uff0cIsValid \u4e5f\u662f\u65b9\u6cd5\u3002\u8fd9\u79cd\u5f53\u7136 GetManager \u4f1a\u8fd4\u56de\u4e00\u4e2a\u5bf9\u8c61\u3002\u6700\u7ec8\u5bfc\u81f4 GetManager().IsValid(fileName) \u4e8b\u5b9e\u4e0a\u662f \u5bf9\u8c61\u540d.\u65b9\u6cd5 \u7684\u8c03\u7528\u3002\u4f46\u662f GetManager().IsValid(fileName)\u5f62\u5f0f\u4e0a\u8fd8\u662f \u65b9\u6cd5.\u65b9\u6cd5 \u8c03\u7528\u65b9\u5f0f \u3002
\u6211\u7684\u95ee\u9898\u662f\uff1a\u65b9\u6cd5.\u65b9\u6cd5 \u7684\u8fd9\u79cd\u8bed\u6cd5\u6709\u4ec0\u4e48\u201c\u4e13\u6709\u540d\u8bcd\u201d\u6765\u5b9a\u4e49\u8fd9\u79cd\u8bed\u6cd5\u4e48\uff1f\u6211\u60f3\u6839\u636e\u201c\u4e13\u6709\u540d\u8bcd\u201d\u53bb\u67e5\u4e00\u4e0b\u8fd9\u4e2a\u8bed\u6cd5\u7684\u4f7f\u7528\u9650\u5236\u7b49\u76f8\u5173\u77e5\u8bc6\u3002

public class LogAnalyzerUsingFactoryMethod
{
public bool IsValidLogFileName(string fileName)
{
return GetManager().IsValid(fileName);
}
protected virtual IExtensionManager GetManager()
{
return new FileExtensionManager();
}
}" }, { "author": { "url": "member/huzhikuizainali", "name": "huzhikuizainali", "avatar": "https://cdn.v2ex.com/avatar/1869/a390/522912_large.png?m=1752498684" }, "url": "t/992742", "title": "\u8bf7\u95ee\u662f\u5426\u6709 C# \u201c\u5b98\u65b9\u201d\u6587\u6863\uff1f", "id": "t/992742", "date_published": "2023-11-17T04:00:25+00:00", "content_html": "

\u8bf7\u95ee\u662f\u5426\u5b58\u5728 C# \u201c\u5b98\u65b9\u201d \u6587\u6863\uff1f\u6211\u641c\u7d22\u5230\u5982\u4e0b\u7f51\u5740\uff1a https://learn.microsoft.com/zh-cn/dotnet/csharp/

\n

\u611f\u89c9\u5e94\u8be5\u662f\u5b98\u65b9\u6587\u6863\u3002\u4f46\u662f\u5f53\u6211\u6253\u5f00\u8fd9\u4e2a\u9875\u9762\u641c\u7d22\u7ed3\u679c\u9875\u65f6\uff0c\u53d1\u73b0\u6807\u9898\u540e\u9762\u90fd\u4f1a\u663e\u793a\u4e2a\u4eba\u4f5c\u8005\u540d\u3002\u6253\u5f00\u8fd9\u4e9b\u4f5c\u8005\u540d\u4ee5\u540e\u53d1\u73b0\u4ed6\u4eec\u5e76\u6ca1\u6709\u663e\u8457\u7684\u5fae\u8f6f\u5b98\u65b9\u804c\u4f4d\u3002\u6240\u4ee5\u8fd9\u4e2a\u7f51\u5740\u7684\u5185\u5bb9\u662f\u5426\u5c5e\u4e8e C#\u5b98\u65b9\u6587\u6863\uff1f

\n

\u6216\u8005\u8fd9\u53ea\u662f\u5fae\u8f6f\u7248\u7684 CSDN \uff1f\u5982\u679c\u8fd9\u662f\u5fae\u8f6f\u7248\u7684 CSDN \uff0c\u90a3\u4e48\u771f\u6b63\u7684\u5b98\u65b9 C#\u6587\u6863\u5730\u5740\u5728\u54ea\u91cc\u5462\uff1f

\n" }, { "author": { "url": "member/shanyang88", "name": "shanyang88", "avatar": "https://cdn.v2ex.com/gravatar/3f20bfd17cf0564f0ebc27c9a2e594a9?s=73&d=retro" }, "url": "t/992529", "date_modified": "2023-11-16T10:34:27+00:00", "content_html": "

\u9006\u5411\u5c0f\u767d\u8bf7\u6559\uff0c\u4e3a\u5565 c#\u5199\u51fa\u6765\u7684\u6709\u7684 exe \u7a0b\u5e8f\uff0c\u62d6\u5230 dnSpy \u91cc\u53ef\u4ee5\u770b\u5230\u6e90\u4ee3\u7801\uff0c\u800c\u6709\u7684\u53ea\u80fd\u770b\u5230 PE \uff08\u7528 exeInfo \u67e5\u4e86\u6ca1\u6709\u52a0\u58f3\uff0c\u4e14\u53ef\u4ee5\u7528 exeInfo rip \u51fa\u6765\u4e00\u5806 dll \u6587\u4ef6\uff0c\u800c\u8fd9\u4e9b dll \u6587\u4ef6\u62d6\u5230 dnSpy \u91cc\u662f\u53ef\u4ee5\u770b\u5230\u6e90\u7801\u7684\uff09\uff1f

\n", "date_published": "2023-11-16T10:03:10+00:00", "title": "\u5173\u4e8e c#\u8f6f\u4ef6\u7684\u9006\u5411\u5206\u6790", "id": "t/992529" }, { "author": { "url": "member/shanyang88", "name": "shanyang88", "avatar": "https://cdn.v2ex.com/gravatar/3f20bfd17cf0564f0ebc27c9a2e594a9?s=73&d=retro" }, "url": "t/991855", "date_modified": "2023-11-14T12:04:54+00:00", "content_html": "

\u6bd4\u5982\u628a\u8fd9\u4e2a exe \u6587\u4ef6\u62c9\u5230 ultra editor \u91cc\u8fdb\u884c\u641c\u7d22\u3002\n\u5177\u4f53\u5730\u8bf4\uff0c\u6211\u60f3\u5728\u751f\u6210\u7684 exe \u6587\u4ef6\u91cc\u641c\u7d22\u4ee5\u4e0b\u4ee3\u7801\u6bb5\u4e2d\u7684 xxxxx: \tdefaultStringHandler.BFormatted(Utils.Base64Decode(\"xxxxx\"));\n\u4e0d\u77e5\u662f\u5426\u53ef\u4ee5\u641c\u5230\uff1f\u8c8c\u4f3c\u4e0d\u884c\uff1f

\n", "date_published": "2023-11-14T08:11:30+00:00", "title": "c#\u7a0b\u5e8f\u91cc\u7684\u4e00\u4e2a\u5b57\u7b26\u4e32\u53c2\u6570\uff0c\u53ef\u4ee5\u5728\u751f\u6210\u7684 exe \u6587\u4ef6\u91cc\u641c\u7d22\u5230\u5417\uff1f", "id": "t/991855" }, { "author": { "url": "member/huzhikuizainali", "name": "huzhikuizainali", "avatar": "https://cdn.v2ex.com/avatar/1869/a390/522912_large.png?m=1752498684" }, "url": "t/988705", "date_modified": "2023-11-04T17:10:30+00:00", "content_html": "

\"piQ37PU.png\"

\n

\u89c1\u4e0a\u56fe\uff0c\u7528 vscode \u8c03\u8bd5 C# \u4e3a\u4ec0\u4e48\u9700\u8981\u65b0\u5efa\u9879\u76ee\u554a\u3002\u9879\u76ee\u4e0b\u9762\u6709\u4e00\u5806\u6587\u4ef6\u3002\u6211\u7528 matlab \u5b66\u6253\u4e2a hello word \u3002\u53ea\u9700\u8981\u4e00\u4e2a\u4ee3\u7801\u6587\u4ef6\u5c31\u53ef\u4ee5\u4e86\u3002\u5230\u4e86 C# \u53ea\u65b0\u5efa\u4e00\u4e2a.cs \u6587\u4ef6\u4ec0\u4e48\u4e5f\u5e72\u4e0d\u4e86\u3002\u5fc5\u987b\u8981 dotnet new console \u65b0\u5efa\u9879\u76ee

\n

--------------------- \u6211\u53d1\u73b0\u4e00\u822c\u8bb2\u4ee3\u7801\u7684\u4e66\u6216\u89c6\u9891\u5bf9\u6b64\u90fd\u662f\u4e00\u4ee3\u800c\u8fc7\u3002\u53ea\u6559\u600e\u4e48\u65b0\u5efa\u9879\u76ee\u3002\u4e0d\u89e3\u91ca\u8fd9\u4e9b\u6587\u4ef6\u7684\u4f5c\u7528\u548c\u610f\u4e49\u3002\u6211\u60f3\u5148\u5bf9\u8fd9\u4e9b\u6587\u4ef6\u7684\u542b\u4e49\u6709\u4e2a\u6574\u4f53\u6982\u5ff5\u3002\u56e0\u4e3a\u6211\u60f3\u5728 vscode \u91cc\u7528 NUnit \u8dd1\u4e2a\u5355\u5143\u6d4b\u8bd5\uff0c\u4f53\u4f1a\u4e00\u4e0b\u4e66\u4e0a\u7684\u4ee3\u7801\u3002\u6ca1\u60f3\u5230\u4e00\u4e0a\u6765\u5c31\u88ab\u8fd9\u4e9b\u9879\u76ee\u6587\u4ef6\u7ed9\u641e\u6655\u4e86\u3002\u5728 matlab \u4e2d\u53ea\u9700\u8981\u6e90\u4ee3\u7801\uff0c\u5c31\u53ef\u4ee5\u8dd1\u8d77\u6765\uff0c\u6253\u65ad\u70b9,\u770b\u7ed3\u679c\u3002\n\u5173\u4e8e\u8fd9\u4e9b\u6587\u4ef6\uff0c\u6211\u60f3\u641e\u61c2\u4ed6\u4eec\u7684\u4f5c\u7528\uff0c\u610f\u4e49\u3002\u5bf9\u7a0b\u5e8f\u7684\u7f16\u8bd1\u8fd0\u884c\u6709\u4ec0\u4e48\u5f71\u54cd\u3002\u80cc\u540e\u7684\u6982\u5ff5\u3002\u6709\u4ec0\u4e48\u4e66\u7c4d\u6216\u89c6\u9891\u63a8\u8350\u4e48\uff1f\u79d1\u666e\u5411\u7684\u3002\u6211\u81ea\u5b66\uff01

\n", "date_published": "2023-11-04T17:06:11+00:00", "title": "C#\u65b0\u5efa\u9879\u76ee\u540e\u65b0\u5efa\u7684\u5404\u79cd\u6587\u4ef6\u7684\u4f5c\u7528\u662f\u4ec0\u4e48\uff1f", "id": "t/988705" }, { "author": { "url": "member/huzhikuizainali", "name": "huzhikuizainali", "avatar": "https://cdn.v2ex.com/avatar/1869/a390/522912_large.png?m=1752498684" }, "url": "t/987688", "title": "\u8bf7\u95ee\u8fd9\u4e2a\u8bbf\u95ee\u63a7\u5236\u58f0\u660e\u662f\u5426\u6709\u70b9\u591a\u4f59\uff1f", "id": "t/987688", "date_published": "2023-11-02T00:27:11+00:00", "content_html": "

\u8bf7\u770b\u4e0b\u9762\u7684\u4ee3\u7801\uff1a

\n

1 \u3001\u8fd9\u4e2a\u7c7b\u58f0\u660e\u4e86\u4e00\u4e2a\u5c5e\u6027 RPM \uff0c\u663e\u7136\u5e0c\u671b set \u662f private \uff0c\u6211\u731c\u6d4b\u8fd9\u6837\u58f0\u660e\u4f1a\u5bfc\u81f4\uff0cget \u662f public \uff1f

\n

2 \u3001\u6211\u77e5\u9053 C++\u7684 class \u9ed8\u8ba4\u5c5e\u6027\u90fd\u662f private \uff0c\u6240\u4ee5\u8981\u663e\u793a\u58f0\u660e public \uff0cC#\u4e5f\u662f\u5982\u6b64\uff1f

\n

3 \u3001\u8fd9\u4e2a\u5c5e\u6027\u6539\u6210 int RPM{public get; private set; } \u662f\u4e0d\u662f\u53ef\u4ee5\u8fbe\u5230\u540c\u6837\u7684\u6548\u679c\uff1f

\n

class Engine {

\n

public int RPM{get; private set; }

\n

}

\n" }, { "author": { "url": "member/wxg4net", "name": "wxg4net", "avatar": "https://cdn.v2ex.com/avatar/9fbc/bcb4/23056_large.png?m=1706573512" }, "url": "t/984081", "date_modified": "2023-10-22T03:58:32+00:00", "content_html": "", "date_published": "2023-10-21T10:15:40+00:00", "title": "\u8bf7\u6559\uff0c c#\u8bed\u8a00\u4e2d\uff0c\u4e00\u4e2a\u56de\u8c03\u51fd\u6570\u4e2d\u4f7f\u7528 lock \u90e8\u5206\u6267\u884c\u8f83\u6162\u7684\u4ee3\u7801\uff0c\u540e\u7eed\u6267\u884c\u56de\u8c03\u51fd\u6570\u4e2d lock \u64cd\u4f5c\u6267\u884c\u987a\u5e8f\u662f\u4e0d\u662f\u4e0d\u80fd\u4fdd\u8bc1\u5148\u6267\u884c\u987a\u5e8f", "id": "t/984081" }, { "author": { "url": "member/huzhikuizainali", "name": "huzhikuizainali", "avatar": "https://cdn.v2ex.com/avatar/1869/a390/522912_large.png?m=1752498684" }, "url": "t/980459", "date_modified": "2023-10-09T21:55:43+00:00", "content_html": "

\u95ee\u9898\u7b80\u8ff0\uff1a\u4e66\u4e2d\u8bf4\u6570\u7ec4\u6392\u5e8f\u53ef\u4ee5\u4f7f\u7528 Array.Sort \u65b9\u6cd5\u3002\u4f46\u662f\u5982\u679c\u4f60\u81ea\u5df1\u5199\u4e86\u4e00\u4e2a\u7c7b Myclass \uff0c\u7136\u540e\u5b9e\u4f8b\u5316\u4e00\u4e2a Myclass \u7c7b\u578b\u7684\u6570\u7ec4\uff0c\u5c31\u6ca1\u6709\u529e\u6cd5\u4f7f\u7528 sort \u65b9\u6cd5\u6392\u5e8f\uff0c\u56e0\u4e3a Array \u7c7b\u7684 Sort \u65b9\u6cd5\u5176\u5b9e\u4f9d\u8d56\u5343\u4e00\u4e2a\u53eb\u4f5c IComparable \u7684\u63a5\u53e3\uff0c\u5b83\u58f0\u660e\u5728 BCL \u4e2d\uff0c\u5305\u542b\u552f\u4e00\u7684\u65b9\u6cd5 CompareTo \u3002IComparable \u63a5\u53e3\u7684\u58f0\u660e\u3002\u6ce8\u610f\uff0c\u63a5\u53e3\u4e3b\u4f53\u5185\u5305\u542b CompareTo \u65b9\u6cd5\u7684\u58f0\u660e\uff0c\u6307\u5b9a\u4e86\u5b83\u63a5\u53d7\u4e00\u4e2a object \u7c7b\u578b\u7684\u53c2\u6570\u3002\u5c3d\u7ba1\u8be5\u65b9\u6cd5\u5177\u6709\u540d\u79f0\u3001\u53c2\u6570\u548c\u8fd4\u56de\u7c7b\u578b\uff0c\u5374\u6ca1\u6709\u5b9e\u73b0\u3002\u5c3d\u7ba1\u5728\u63a5\u53e3\u58f0\u660e\u4e2d\u6ca1\u6709\u4e3a CompareTo \u65b9\u6cd5\u63d0\u4f9b\u5b9e\u73b0\uff0c\u4f46 IComparable \u63a5\u53e3\u7684 NET \u6587\u6863\u4e2d\u63cf\u8ff0\n\u4e86\u8be5\u65b9\u6cd5\u5e94\u8be5\u505a\u7684\u4e8b\u60c5\uff0c\u4f60\u53ef\u4ee5\u5728\u521b\u5efa\u5b9e\u73b0\u8be5\u63a5\u53e3\u7684\u7c7b\u6216\u7ed3\u6784\u65f6\u53c2\u8003\u3002\u6587\u6863\u4e2d\u5199\u9053\uff0c\u5728\u8c03\u7528\nCompareTo \u65b9\u6cd5\u65f6\uff0c\u5b83\u5e94\u8be5\u8fd4\u56de\u4ee5\u4e0b\u51e0\u4e2a\u503c\u4e4b\u4e00\uff1a

\n

1 \u3001\u8d1f\u6570\u503c\u5982\u679c\u5f53\u524d\u5bf9\u8c61\u5c0f\u4e8e\u53c2\u6570\u5bf9\u8c61\uff1b

\n

2 \u3001\u6b63\u6570\u503c\u5982\u679c\u5f53\u524d\u5bf9\u8c61\u5927\u4e8e\u53c2\u6570\u5bf9\u8c61\uff1b

\n

3 \u3001\u96f6\u5982\u679c\u4e24\u4e2a\u5bf9\u8c61\u5728\u6bd4\u8f83\u65f6\u76f8\u7b49\u3002

\n

Sort \u4f7f\u7528\u7684\u7b97\u6cd5\u4f9d\u8d56\u4e8e\u4f7f\u7528\u5143\u7d20\u7684 CompareTo \u65b9\u6cd5\u6765\u51b3\u5b9a\u4e24\u4e2a\u5143\u7d20\u7684\u6b21\u5e8f\u3002int \u7c7b\u578b\u5b9e\u73b0\u4e86 IComparable, \u4f46\u662f MyClass \u6ca1\u6709\uff0c\u56e0\u6b64\u5f53 Sort \u5c1d\u8bd5\u8c03\u7528 MyClass \u4e0d\u5b58\u5728\u7684 CompareTo \u65b9\u6cd5\u65f6\u4f1a\u629b\u51fa\u5f02\u5e38\u3002

\n

---------\u592a\u597d\u4e86\uff0c\u53ea\u8981\u6211\u7684 Myclass \u7ee7\u627f\u4e86 IComparable \u63a5\u53e3\u3002\u5c31\u53ef\u4ee5\u6109\u5feb\u7684\u4f7f\u7528 sort \u65b9\u6cd5\u4e86\u5427\uff1f\u53ef\u662f\u770b\u5230\u4e0b\u9762\u4ee3\u7801\u7684\u65f6\u5019\u6211\u5c31\u6c89\u9ed8\u4e86\u3002\u4f60\u770b\u7b2c\u4e09\u884c\uff0c\u5b83\u600e\u4e48\u81ea\u5df1\u5b9e\u73b0\u4e86 CompareTo \u65b9\u6cd5\u3002\u96be\u9053\u6211\u7ee7\u627f\u4e86 IComparable \u63a5\u53e3\u4e0d\u5c31\u662f\u4e0d\u60f3\u91cd\u590d\u9020\u8f6e\u5b50\u4e48\uff1f\u5982\u679c\u6211\u81ea\u5df1\u91cd\u5199 CompareTo \uff0c\u90a3\u8fd8\u4e0d\u5982\u4e0d\u7ee7\u627f\u63a5\u53e3\uff0c\u81ea\u5df1\u76f4\u63a5\u624b\u5199 sort \u65b9\u6cd5\u4e0d\u5c31\u5b8c\u4e86\uff1f\n\u96be\u9053 BCL \u4e2d\u5c31\u6ca1\u6709\u81ea\u5df1\u7684 CompareTo \uff1f\u5982\u679c\u6ca1\u6709\u81ea\u5e26\u7684 CompareTo \uff0c\u90a3\u4e48\u5f53\u4f60\u5bf9\u6807\u51c6\u6570\u7ec4\u6392\u5e8f\u8c03\u7528 sort \u65b9\u6cd5\u65f6\uff0csort \u8c03\u7528\u7684\u662f\u8c01\u7684 CompareTo \u65b9\u6cd5\u5462\uff1f

\n

\"\"\n\"\"\n\"\"

\n", "date_published": "2023-10-09T21:54:14+00:00", "title": "\u65e2\u7136\u5df2\u7ecf\u7ee7\u627f\u4e86 BCL \u4e2d\u7684 IComparable \u63a5\u53e3\uff0c\u4e3a\u4ec0\u4e48\u8fd8\u8981\u81ea\u5df1\u5199 CompareTo \u65b9\u6cd5\u7684\u5b9e\u73b0\uff1f", "id": "t/980459" }, { "author": { "url": "member/huzhikuizainali", "name": "huzhikuizainali", "avatar": "https://cdn.v2ex.com/avatar/1869/a390/522912_large.png?m=1752498684" }, "url": "t/980064", "title": "C#\u4e2d\u7c7b \u7c7b\u578b\u7684\u53d8\u91cf\u662f\u901a\u5e38\u6240\u8bf4\u7684\u201c\u5bf9\u8c61\u4e48\uff1f\u201d\u7c7b\u7684\u5b9e\u4f8b\u53c8\u662f\u4ec0\u4e48\uff1f", "id": "t/980064", "date_published": "2023-10-08T20:48:34+00:00", "content_html": "

\u6211\u9762\u5411\u5bf9\u8c61\u7684\u77e5\u8bc6\u6765\u81ea\u4e8e matlab \uff0c\u6bd4\u8f83\u7b80\u5355\u3002\u6bd4\u5982\u4f60\u5b9a\u4e49\u4e86\u4e00\u4e2a class A \uff0c\u90a3\u4e48\u4f60\u5b9e\u4f8b\u5316\u4e00\u4e2a\u5bf9\u8c61\u5c31\u7528 a=A(); \u5c31\u53ef\u4ee5\u4e86\uff08\u5047\u8bbe\u7c7b A \u7684\u6784\u9020\u51fd\u6570\u5141\u8bb8\u53c2\u6570\u4e3a\u7a7a\uff09\n\u4f46\u662f\u5230\u4e86 C#\uff0c\u6211\u53d1\u73b0\u6bd4\u8f83\u590d\u6742\u3002\u8bf7\u770b\u4e0b\u9762\u7684\u622a\u56fe\u3002\u7ed9\u51fa\u4e86\u4e00\u4e2a \u201c\u7c7b \u7c7b\u578b\u7684\u53d8\u91cf\u201d \u6982\u5ff5\u3002\u8bf7\u95ee\u8fd9\u4e2a\u53d8\u91cf\u662f\u901a\u5e38\u8bf4\u7684\u201c\u5bf9\u8c61\u201d\u4e48\uff1f \u548c\u201c\u7c7b\u7684\u5b9e\u4f8b\u201d \u662f\u4e00\u56de\u4e8b\u4e48\uff1f \u56e0\u4e3a\u8fd9\u6bb5\u6587\u5b57\u4e2d\u6ca1\u6709\u7ed9\u51fa\u201c\u7c7b\u7684\u5b9e\u4f8b\u201d\u7684\u660e\u786e\u5b9a\u4e49\uff08 matlab \u4e2d\u5bf9\u8c61\u548c\u7c7b\u7684\u5b9e\u4f8b\u662f\u4e00\u56de\u4e8b\uff09

\n
 \u622a\u56fe\n
\n

\"\"

\n

\u4e4b\u6240\u4ee5\u7ea0\u7ed3\u8fd9\u4e2a\u95ee\u9898\uff0c\u662f\u56e0\u4e3a\u4e0b\u9762\u7684\u60c5\u51b5\u662f\u5728 matlab \u9762\u5411\u5bf9\u8c61\u7a0b\u5e8f\u4e2d\u4ece\u672a\u9047\u5230\u7684\u60c5\u51b5\u3002mgr \u5230\u5e95\u662f\u54ea\u4e2a\u7c7b\u7684\u5bf9\u8c61\u5462\uff1f IExtensionManager \u7684\uff1f FileExtensionManage \uff1f \u867d\u7136 FileExtensionManage \u662f IExtensionManager \u7684\u5b50\u7c7b \uff0c\u4f46\u662f\u4e8c\u8005\u7684\u5b57\u6bb5 \u6570\u91cf\u53ef\u80fd\u90fd\u4e0d\u4e00\u6837\uff0c\u6700\u540e mgr \u5230\u5e95\u4ee5\u8c01\u4e3a\u6a21\u677f\u751f\u6210\u5bf9\u8c61\u4e86\u5462\uff1f\u4f1a\u4e0d\u4f1a\u51fa\u73b0\u9f20\u5934\u9e2d\u8116\u7684\u77db\u76fe\u5462\uff1f

\n
 \u622a\u56fe\n
\n

\"image\"

\n" }, { "author": { "url": "member/huzhikuizainali", "name": "huzhikuizainali", "avatar": "https://cdn.v2ex.com/avatar/1869/a390/522912_large.png?m=1752498684" }, "url": "t/978868", "title": "C#\u5355\u5143\u6d4b\u8bd5\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u8fc7\u591a\u4f7f\u7528 setup\uff1f", "id": "t/978868", "date_published": "2023-10-04T05:51:09+00:00", "content_html": "

\u4f46\u662f\u8981\u6ce8\u610f\uff0c\u4f7f\u7528[Setup] \u8d8a\u591a\uff0c\u6d4b\u8bd5\u4ee3\u7801\u53ef\u8bfb\u6027\u5c31\u8d8a\u5dee\u3002\u4e3a\u4e86\u7406\u89e3\u6d4b\u8bd5\u600e\u4e48\u5f97\u5230\u5b9e\u4f8b\uff0c\u4f7f\u7528\u7684\u5bf9\u8c61\u662f\u4ec0\u4e48\u7c7b\u578b\uff0c\u4eba\u4eec\u4e0d\u5f97\u4e0d\u540c\u65f6\u770b\u6587\u4ef6\u91cc\u7684\u4e24\u5904\u4ee3\u7801\u3002\u6211\u544a\u8bc9\u6211\u7684\u5b66\u751f\uff1a \u201c\u60f3\u8c61\u4e00\u4e0b\uff0c\u4ee3\u7801\u7684\u8bfb\u8005\u548c\u4f60\u4ece\u672a\u8c0b\u9762\u4e5f\u65e0\u6cd5\u8054\u7cfb\uff0c\u5728\u4f60\u79bb\u804c\u4e24\u5e74\u4e4b\u540e\u624d\u6765\u8bfb\u4f60\u7684\u6d4b\u8bd5\u4ee3\u7801\u3002\u4f60\u4f7f\u5f97\u4ee3\u7801\u6613\u8bfb\u7684\u6bcf\u4e00\u4e2a\u5fae\u5c0f\u7684\u52aa\u529b\uff0c\u5bf9\u4ed6\u4eec\u90fd\u662f\u6781\u5927\u7684\u5e2e\u52a9\u3002\u4ed6\u4eec\u5982\u679c\u5bf9\u4f60\u7684\u4ee3\u7801\u6709\u4efb\u4f55\u95ee\u9898\uff0c\u5468\u56f4\u90fd\u4e0d\u4f1a\u6709\u4eba\u80fd\u591f\u89e3\u7b54\uff0c\u6240\u4ee5\u4f60\u662f\u4ed6\u4eec\u552f\u4e00\u7684\u5e0c\u671b\u3002\u201c\u5982\u679c\u8bfb\u4ee3\u7801\u7684\u4eba\u4e3a\u4e86\u80fd\u7406\u89e3\u4f60\u7684\u6d4b\u8bd5\u800c\u4e0d\u5f97\u4e0d\u5728\u4e24\u6bb5\u4ee3\u7801\u95f4\u6765\u56de\u5730\u770b\uff0c\u90a3\u53ef\u4e0d\u662f\u4ec0\u4e48\u597d\u4e3b\u610f\u3002\n\"pPOsKw6.png\"\n\"pPOsY6A.png\"\n\"pPOsa0P.png\"

\n

\u8bf7\u770b\u4e0a\u9762\u8fd9\u6bb5\u5355\u5143\u6d4b\u8bd5\u7684\u8bb2\u89e3\uff0c\u6709\u4e24\u4e2a\u95ee\u9898\uff1a

\n

1 \u3001\u4e3a\u4ec0\u4e48\u201c\u4f7f\u7528[Setup] \u8d8a\u591a\uff0c\u6d4b\u8bd5\u4ee3\u7801\u53ef\u8bfb\u6027\u5c31\u8d8a\u5dee\u3002\u4e3a\u4e86\u7406\u89e3\u6d4b\u8bd5\u600e\u4e48\u5f97\u5230\u5b9e\u4f8b\uff0c\u4f7f\u7528\u7684\u5bf9\u8c61\u662f\u4ec0\u4e48\u7c7b\u578b\uff0c\u4eba\u4eec\u4e0d\u5f97\u4e0d\u540c\u65f6\u770b\u6587\u4ef6\u91cc\u7684\u4e24\u5904\u4ee3\u7801\u3002\u201d \u662f\u56e0\u4e3a\u7531\u4e8e setup \u7684\u5b58\u5728\u3002\u6240\u4ee5\u6bcf\u6267\u884c\u4e00\u6b21 test \u6807\u7b7e\u7684\u4ee3\u7801\u5c31\u4f1a\u91cd\u65b0\u6267\u884c\u4e00\u6b21 m_analyzer = new LogAnalyzer(); \u4e48? \u4f46\u662f\u8fd9\u4e3a\u4ec0\u4e48\u4f1a\u5bfc\u81f4\u53ef\u8bfb\u6027\u53d8\u5dee\u3002\u4e3a\u4ec0\u4e48\u4f1a\u4e0d\u5f97\u4e0d\u540c\u65f6\u770b\u6587\u4ef6\u91cc\u7684\u4e24\u5904\u4ee3\u7801\uff1f\u800c\u4e14\u4e66\u4e2d\u8bf4\u4e00\u6bb5\u6d4b\u8bd5\u4ee3\u7801\u53ea\u80fd\u4f7f\u7528\u4e00\u4e2a setup \u6a21\u5757\u3002\u6240\u4ee5\u4f55\u6765\u201c\u4f7f\u7528[Setup] \u8d8a\u591a\u201d\u7684\u95ee\u9898\u5462\uff1f

\n

2 \u3001\u4e3a\u4ec0\u4e48\u4ee3\u7801\u4e2d\u6700\u540e\u4e00\u90e8\u5206 public void TearDown () \u8bf4\u201c\u4e0d\u662f\u5fc5\u987b\u7684\uff0c\u5728\u771f\u5b9e\u5239\u8bd5\u4e2d\u8bf7\u4e0d\u8981\u4f7f\u7528\u201d

\n" }, { "author": { "url": "member/d3js", "name": "d3js", "avatar": "https://cdn.v2ex.com/gravatar/e5ac2b427e5301e795fc05a5f6862a78?s=73&d=retro" }, "url": "t/970756", "title": "C# \u7c7b\u4e2d\u7684\u8fd9\u4e2a\u6784\u9020\u51fd\u6570\u80fd\u4e0d\u80fd\u7701\u7565\uff1f", "id": "t/970756", "date_published": "2023-09-04T05:56:25+00:00", "content_html": "
// \u50cf\u7d20\u8f6c\u6362\u4fe1\u606f\npublic class ConvertParam\n{\n // \u8f93\u5165\u7684\u56fe\u50cf\u4fe1\u606f\n public CImage InImage { get; set; }\n\n // \u8f93\u51fa\u7684\u56fe\u50cf\u4fe1\u606f\n public CImage OutImage { get; set; }\n\n // \u6784\u9020\u51fd\u6570\n public ConvertParam()\n {\n InImage = new CImage();\n OutImage = new CImage();\n }\n}\n
\n

\u5927\u4f6c\u4eec\uff0c\u4e0a\u9762 ConvertParam \u7c7b\u91cc\u9762\u6709\u4e24\u4e2a CImage \u7c7b\u578b\u7684\u5c5e\u6027 InImage \u548c OutImage \uff0c

\n

\u4e0b\u9762\u7684\u65e0\u53c2\u6784\u9020\u51fd\u6570\u80fd\u4e0d\u80fd\u7701\u7565\u5462\uff1f

\n

\u5982\u679c\u4e0d\u80fd\u7684\u8bdd\uff0c\u8fd9\u4e2a\u65e0\u53c2\u6784\u9020\u51fd\u6570\u8d77\u4ec0\u4e48\u5fc5\u8981\u7684\u4f5c\u7528\u5462\uff1f

\n" }, { "author": { "url": "member/d3js", "name": "d3js", "avatar": "https://cdn.v2ex.com/gravatar/e5ac2b427e5301e795fc05a5f6862a78?s=73&d=retro" }, "url": "t/969755", "title": "\u5982\u4f55\u8ba9 C# \u7a97\u4f53\u6807\u7b7e\u7684\u8bed\u8a00\u9ed8\u8ba4\u662f\u4e2d\u6587\uff1f", "id": "t/969755", "date_published": "2023-08-31T06:18:10+00:00", "content_html": "

https://i.imgur.com/jwOoC4R.png

\n

\u7f51\u4e0a\u4e0b\u4e86\u4e00\u4e2a\u6d77\u5eb7\u76f8\u673a C# \u7684 Demo \u3002resx \u6587\u4ef6\u6709\u82f1\u6587\u548c\u4e2d\u6587\u7684\uff0c\u70b9\u201c\u5f00\u59cb\u6267\u884c\u201d\u540e\u5f97\u5230\u7684\u7a97\u4f53\u6807\u7b7e\u7684\u6587\u5b57\u90fd\u662f\u82f1\u6587\u7684\uff0c\u600e\u4e48\u8ba9\u5b83\u9ed8\u8ba4\u663e\u793a\u82f1\u6587\u5462\uff1f

\n

\u672c\u5730\u8ba1\u7b97\u673a\u7684\u5730\u533a\u548c\u8bed\u8a00\u90fd\u662f [\u4e2d\u56fd|\u4e2d\u6587]

\n" }, { "author": { "url": "member/d3js", "name": "d3js", "avatar": "https://cdn.v2ex.com/gravatar/e5ac2b427e5301e795fc05a5f6862a78?s=73&d=retro" }, "url": "t/967135", "date_modified": "2023-08-21T09:03:05+00:00", "content_html": "

\u5b98\u65b9\u5bf9 this \u7684\u5b9a\u4e49\u662f\uff1a

\n

this \u5173\u952e\u5b57\u6307\u4ee3\u7c7b\u7684\u5f53\u524d\u5b9e\u4f8b\uff0c\u8fd8\u53ef\u7528\u4f5c\u6269\u5c55\u65b9\u6cd5\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u7684\u4fee\u9970\u7b26\u3002

\n
\n

\u95ee\u9898\uff1a

\n

1 \u3001\u5728 Forms \u7c7b\u4e2d\uff0c\u4f7f\u7528 this \u7684\u8bdd\uff0c\u7a97\u4f53\u53ef\u4ee5\u5f39\u51fa

\n

2 \u3001\u5728 Forms \u7c7b\u4e2d\uff0c\u4e0d\u4f7f\u7528 this \uff0c\u81ea\u5df1\u53bb\u521b\u5efa\u5b9e\u4f8b\u7684\u8bdd\uff0c\u7a97\u4f53\u65e0\u6cd5\u5f39\u51fa

\n

\u8fd9\u662f\u4e3a\u5565\u5462\uff1f

\n

https://i.imgur.com/9OtxuB3.png

\n

https://i.imgur.com/84UT9Pb.png

\n", "date_published": "2023-08-21T08:56:47+00:00", "title": "C# \u4e2d this \u5173\u952e\u5b57\u5728 Forms \u7c7b\u4e2d\u4f7f\u7528\u7684\u56f0\u60d1", "id": "t/967135" }, { "author": { "url": "member/clevermis", "name": "clevermis", "avatar": "https://cdn.v2ex.com/gravatar/70264146da182d9ea678a55dcbeb84d7?s=73&d=retro" }, "url": "t/962492", "title": "2023 \u5e74\u4e86\uff0c\u503c\u5f97\u5165\u884c C#\u4e0a\u4f4d\u673a\u5417\uff1f", "id": "t/962492", "date_published": "2023-08-04T10:29:50+00:00", "content_html": "

\u4e8c\u672c\u8ba1\u7b97\u673a\u5b66\u751f\uff0cjava \u627e\u4e0d\u5230\u5de5\u4f5c\uff0c\u9009\u62e9\u4e86 C#\u4e0a\u4f4d\u673a\uff0c\u8fc7\u4e9b\u65e5\u5b50\u5165\u804c\uff08\u4e5f\u662f\u6ca1\u529e\u6cd5\uff0cjava \u5b9e\u5728\u662f\u627e\u4e0d\u5230\u5de5\u4f5c\uff09\uff0c\u60f3\u95ee\u4e00\u4e0b C#\u6709\u524d\u9014\u5417\uff1f

\n

\u73b0\u5728\u8be5\u5982\u4f55\u9009\u62e9\u65b9\u5411\uff0c\u5b66\u4e9b\u4ec0\u4e48\u4ee5\u540e\u4f1a\u597d\u4e00\u4e0b\uff08\u60f3\u505a\u4e00\u4e0b\u804c\u4e1a\u89c4\u5212\uff0c\u6bd5\u7adf\u5982\u679c\u88ab\u8f9e\u4e86\uff0c\u6015\u4e0d\u77e5\u9053\u5e72\u4ec0\u4e48\uff09

\n

\u5728\u7f51\u4e0a\u627e\u4e86\u597d\u591a\uff0c\u90fd\u662f\u51e0\u5e74\u524d\u7684\uff0c\u800c\u4e14\u5bf9 C#\u4e5f\u6ca1\u6709\u4e00\u4e9b\u6700\u65b0\u7684\u8bc4\u4ef7

\n" }, { "author": { "url": "member/buxiangqiaodaima", "name": "buxiangqiaodaima", "avatar": "https://cdn.v2ex.com/avatar/2231/c444/457752_large.png?m=1766880961" }, "url": "t/957835", "title": "\u60f3\u5b66\u4e60\u8f89\u8292\u5fae\u5355\u7247\u673a\u5f00\u53d1\uff0c\u6709\u5927\u4f6c\u6709\u5b66\u4e60\u8d44\u6599\u548c\u65b9\u5f0f\u5417", "id": "t/957835", "date_published": "2023-07-18T16:01:43+00:00", "content_html": "\u5c0f\u5f1f\u60f3\u5b66\u4e60\u8fd9\u6b3e\u5355\u7247\u673a\u5f00\u53d1\uff0c\u4f46\u662f\u4e0d\u77e5\u9053\u600e\u4e48\u5165\u624b" }, { "author": { "url": "member/exqibao", "name": "exqibao", "avatar": "https://cdn.v2ex.com/gravatar/1a4d90c901c0e40b30f1d50929ca7b36?s=73&d=retro" }, "url": "t/957313", "title": "\u4f7f\u7528 C#\u7684 HPSocket \u7684\u4e00\u4e2a\u95ee\u9898", "id": "t/957313", "date_published": "2023-07-17T02:33:18+00:00", "content_html": "

\u4f7f\u7528 hpSocket \u5199\u7a0b\u5e8f\u5206\u670d\u52a1\u7aef\u548c\u5ba2\u6237\u7aef\uff0c\u670d\u52a1\u7aef\u6536\u5230\u5ba2\u6237\u7aef\u7684\u4e00\u4e2a\u6d88\u606f\uff0c\u670d\u52a1\u7aef\u4f1a\u54cd\u5e94\u591a\u4e2a\u4fe1\u606f\u7ed9\u5ba2\u6237\u7aef\uff0c\u4f46\u5ba2\u6237\u7aef\u53ea\u6536\u5230\u90e8\u5206\u4fe1\u606f\uff0c\u6536\u5230\u7684\u5305\u90fd\u662f\u5b8c\u6574\u7684\u3002

\n

\u670d\u52a1\u7aef\u65ad\u70b9\u65f6\uff0c\u4e00\u4e2a\u4e00\u4e2a\u770b\u5ba2\u6237\u7aef\u53c8\u80fd\u6536\u5230\uff0c\u5173\u95ed\u65ad\u70b9\u6709\u4f4e\u6982\u7387\u6536\u5230\u5b8c\u6574\uff0c\u5927\u6982\u7387\u53c8\u6536\u4e0d\u5b8c\u5168\u3002

\n

\u5176\u5b9e\u5faa\u73af\u91cc\u9762\u53ea\u7528\u53d1\u4e00\u6b21\uff0c\u8c03\u8bd5\u6545\u610f\u53d1 5 \u6b21\uff0c\u81f3\u5c11\u6536\u5230 1 \u6b21\uff0c\u4f46\u6ca1\u8bd5\u8fc7 5 \u6b21\u90fd\u5168\u6536\u5230\uff0c\u9664\u975e\u5361\u7740\u65ad\u70b9\u4e00\u4e2a\u4e00\u4e2a Send \u8d70\u3002

\n
 // \u521b\u5efa\u5176\u4ed6\u73a9\u5bb6\n foreach (var model in DALManager.Instance.UserDal.GetAllUserModel())\n {\n Server.Send(connid, MessageType.Type_User, MessageType.User_Create_S, model.ID, model.UserInfo.ModelID,\n model.Point);\n Server.Send(connid, MessageType.Type_User, MessageType.User_Create_S, model.ID, model.UserInfo.ModelID,\n model.Point);\n Server.Send(connid, MessageType.Type_User, MessageType.User_Create_S, model.ID, model.UserInfo.ModelID,\n model.Point);\n Server.Send(connid, MessageType.Type_User, MessageType.User_Create_S, model.ID, model.UserInfo.ModelID,\n model.Point);\n Server.Send(connid, MessageType.Type_User, MessageType.User_Create_S, model.ID, model.UserInfo.ModelID,\n model.Point);\n }\n
\n

\u5c01\u88c5\u7684 Send \u65b9\u6cd5\uff1b

\n
 public static void Send(IntPtr connid, byte type, int command, params object[] content)\n {\n Message message = new Message(type, command, content);\n byte[] bytes = Message.ToBytes(message);\n server.Send(connid, bytes, bytes.Length);\n }\n
\n

hp-socket \u7684\u4ee3\u7801\u4e86\uff1b

\n
 public bool Send(IntPtr connId, byte[] bytes, int length)\n {\n GCHandle gcHandle = GCHandle.Alloc((object) bytes, GCHandleType.Pinned);\n bool flag = HPSocket.Sdk.Server.HP_Server_Send(this.SenderPtr, connId, gcHandle.AddrOfPinnedObject(), length);\n this.SysErrorCode.Value = flag ? 0 : Sys.SYS_GetLastError();\n gcHandle.Free();\n return flag;\n }\n
\n

\u4f3c\u4e4e\u8fde\u7eed\u603b\u662f\u4f1a\u4e22\u5931\u540e\u9762\u7684\uff0c\u6709\u5927\u4f6c\u77e5\u9053\u95ee\u9898\u5728\u54ea\u5417\uff1f

\n" }, { "author": { "url": "member/LaTero", "name": "LaTero", "avatar": "https://cdn.v2ex.com/gravatar/96e6305c2a4f1e03047711292dfb2199?s=73&d=retro" }, "url": "t/953465", "title": "C# \u6709\u6ca1\u6709 Rust \u548c Lisp \u90a3\u6837\uff0c if/match \u80fd\u76f4\u63a5\u6c42\u503c\uff0c\u50cf\u4e09\u76ee\u8fd0\u7b97\u7b26\u4e00\u6837\u7684\u529f\u80fd\uff1f", "id": "t/953465", "date_published": "2023-07-02T11:25:53+00:00", "content_html": "

\u6700\u8fd1 Unity DOTS \u8fdb\u5165 LTS \u4e86\uff0c\u60f3\u8bd5\u4e00\u8bd5\uff0c\u5e73\u65f6 C#\u7528\u5f97\u5c11\uff0c\u5168\u51ed IDE \u786c\u5199\uff0c\u521d\u59cb\u5316\u5e38\u91cf\u9047\u5230\u4e86\u8fd9\u6837\u7684\u95ee\u9898\uff0c\u5982 Rust \u4e2d\uff1a

\n
let a = if <slow operation A> {\n 1\n} else if <slow operation B> {\n 2\n} else {\n 3\n};\n
\n

\uff08\u6ce8\uff1aRust \u4e0d\u5e26mut\u9ed8\u8ba4\u662f\u5e38\u91cf\uff09

\n

\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd\u7684\u8bdd\uff0ca \u5c31\u5f97\u58f0\u660e\u6210 mutable \uff0c\u7136\u540e\u5728\u6761\u4ef6\u5206\u652f\u91cc\u9762\u6539\uff0c\u6216\u8005\u7528\u4e00\u957f\u4e32?:?:\u3002\n\u7528 C++\u7684\u65f6\u5019\u662f\u7528\u4e00\u4e2a\u4e34\u65f6\u7684 lambda \uff0c\u5728\u6761\u4ef6\u91cc return \u3002

\n
const int i = [&]() {\n if (<slow operation A>)\n return 1;\n else if (<slow operation A>)\n return 2;\n else\n return 3;\n}();\n
\n

\u770b V \u7ad9\u7ecf\u5e38\u6709\u4eba\u8bf4 C#\u529f\u80fd\u5927\u6742\u70e9\uff0c\u6709\u6ca1\u6709\u597d\u4e00\u70b9\u7684\u529e\u6cd5\uff1f

\n" }, { "author": { "url": "member/exqibao", "name": "exqibao", "avatar": "https://cdn.v2ex.com/gravatar/1a4d90c901c0e40b30f1d50929ca7b36?s=73&d=retro" }, "url": "t/953228", "title": "\u6cdb\u578b\u5b58 List \u7684\u4e00\u4e2a\u95ee\u9898", "id": "t/953228", "date_published": "2023-07-01T04:44:00+00:00", "content_html": "

\u6700\u8fd1\u5728\u770b\u89c6\u9891\u5b66\u4e60 untiy \u6ca1\u6709\u6e90\u7801\uff0c\u8ddf\u7740\u89c6\u9891\u505a\u9047\u5230\u4e00\u4e2a\u95ee\u9898\u3002

\n

\u5c31\u662f\u5b9e\u73b0\u7ee7\u627f\u5355\u4f8b\u201cMySingletonBase\u201d\uff0c\u7ba1\u7406\u57fa\u7c7b\u201cManagerBase\u201d\u7ee7\u627f\u201cMySingletonBase\u201d\u5b9e\u73b0\u5355\u4f8b\uff0c\u201cUIManager\u201d\u53c8\u7ee7\u627f\u201cManagerBase\u201d\uff0c\u73b0\u5728\u7684\u95ee\u9898\u5c31\u662f\u5047\u5982\u6709\u597d\u591a\u4e2a\u201cManagerBase\u201d\u7684\u5b9e\u73b0\u7c7b\u600e\u4e48\u5b58\u5230\u4e00\u4e2a\u201cList<ManagerBase<MonoBehaviour>> Managers = new List<ManagerBase<MonoBehaviour>>()\u201d\u91cc\u9762\uff0c\u4e3b\u8981\u5c31\u662f\u90a3\u4e2a\u6cdb\u578b\u201cT\u201d\u4e0d\u77e5\u9053\u600e\u4e48\u5904\u7406\uff0c\u4e00\u76f4\u63d0\u793a\u7c7b\u578b\u4e0d\u5bf9\u3002

\n

\u770b\u89c6\u9891\u5c31\u770b\u5230\u201cUIManager : ManagerBase<UIManager>\u201d\u662f\u8fd9\u4e48\u5199\uff0c\u81f3\u4e8e List \u600e\u4e48\u6539\u90fd\u5b58\u4e0d\u8fdb\u53bb\uff0c\u5b58\u8fdb\u53bb\u540e\u4e3b\u8981\u5c31\u662f\u904d\u5386\u6267\u884c ManagerBase \u7684\u65b9\u6cd5\uff0c\u6cdb\u578b T \u5bf9\u4e8e\u201cManagerBase\u201d\u4e5f\u6ca1\u6709\u4ec0\u4e48\u7528\uff0c\u53ea\u4e3a\u4e86\u4f20\u7ed9\u201cMySingletonBase\u201d\u3002

\n

\u600e\u4e48\u624d\u80fd\u6b63\u5e38\u5b58 List \u5e76\u904d\u5386\u6267\u884c ManagerBase \u7684\u65b9\u6cd5\uff1f

\n
using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class MySingletonBase <T> : MonoBehaviour where T : MonoBehaviour\n{\n\n private static T instance;\n\n public static T Instance\n {\n get\n {\n return instance;\n }\n }\n\n void Awake() {\n instance = this as T;\n }\n}\n\n
\n
using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing Net;\nusing UnityEngine;\n\npublic abstract class ManagerBase<T> : MySingletonBase<T> where T : MonoBehaviour\n{\n public List<MonoBase> MOnos= new List<MonoBase>();\n\n public void Register(MonoBase monoBase)\n {\n if (!Monos.Contains(monoBase))\n {\n Monos.Add(monoBase);\n }\n }\n \n ....\n}\n\n
\n
using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing Net;\nusing UnityEngine;\n\npublic class UIManager : ManagerBase<UIManager>\n{\n protected override byte GetMessageType()\n {\n return MessageType.Type_Acount;\n }\n}\n
\n" }, { "author": { "url": "member/Wataru", "name": "Wataru", "avatar": "https://cdn.v2ex.com/avatar/cbec/e774/553060_large.png?m=1751178974" }, "url": "t/945937", "title": "\u6709 C++\u57fa\u7840\u5165\u95e8 C#\u6709\u63a8\u8350\u7684\u4e66\u6216\u8bfe\u7a0b\u5417\uff0c\u51c6\u5907\u5b66\u4e60 unity \u6e38\u620f\u5f00\u53d1", "id": "t/945937", "date_published": "2023-06-05T06:59:08+00:00", "content_html": "\u6c42\u5927\u4f6c\u4eec\u63a8\u8350\u672c\u4e66\u6216\u8bfe\u7a0b" } ] } ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86