├── Fast-Enumerate-List
├── global.json
├── FastEnumerateList.csproj
├── FastEnumerateList.sln
└── Program.cs
├── Use-SourceGenerator-Logger
├── global.json
├── SGIlogger.csproj
├── SGIlogger.sln
└── Program.cs
├── CSharp-Dll-Export
├── CSharpDllExport
│ ├── CSharpDllExport.csproj
│ └── DoSomethings.cs
├── LoadLibrary.c
│ ├── LoadLibrary.c.vcxproj.filters
│ ├── LoadLibrary.c
│ └── LoadLibrary.c.vcxproj
└── CSharpDllExport.sln
├── Get-GC-STW-Time
├── GCSTWTime.csproj
├── GCMode.sln
└── Program.cs
├── LICENSE
└── .gitignore
/Fast-Enumerate-List/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "sdk": {
3 | "version": "6.0.0",
4 | "rollForward": "latestMinor",
5 | "allowPrerelease": false
6 | }
7 | }
--------------------------------------------------------------------------------
/Use-SourceGenerator-Logger/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "sdk": {
3 | "version": "6.0.0",
4 | "rollForward": "latestMinor",
5 | "allowPrerelease": false
6 | }
7 | }
--------------------------------------------------------------------------------
/CSharp-Dll-Export/CSharpDllExport/CSharpDllExport.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net7.0
5 | disable
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Get-GC-STW-Time/GCSTWTime.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net7.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Fast-Enumerate-List/FastEnumerateList.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | enable
7 | enable
8 | true
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Use-SourceGenerator-Logger/SGIlogger.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | enable
7 | enable
8 | true
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Get-GC-STW-Time/GCMode.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GCSTWTime", "GCSTWTime.csproj", "{D7A16F24-2B04-4117-9E54-E7E6736484AF}"
4 | EndProject
5 | Global
6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
7 | Debug|Any CPU = Debug|Any CPU
8 | Release|Any CPU = Release|Any CPU
9 | EndGlobalSection
10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
11 | {D7A16F24-2B04-4117-9E54-E7E6736484AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12 | {D7A16F24-2B04-4117-9E54-E7E6736484AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
13 | {D7A16F24-2B04-4117-9E54-E7E6736484AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
14 | {D7A16F24-2B04-4117-9E54-E7E6736484AF}.Release|Any CPU.Build.0 = Release|Any CPU
15 | EndGlobalSection
16 | EndGlobal
17 |
--------------------------------------------------------------------------------
/Use-SourceGenerator-Logger/SGIlogger.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SGIlogger", "SGIlogger.csproj", "{3698FCF8-DBB1-4889-B2D8-3F741D2958F5}"
4 | EndProject
5 | Global
6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
7 | Debug|Any CPU = Debug|Any CPU
8 | Release|Any CPU = Release|Any CPU
9 | EndGlobalSection
10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
11 | {3698FCF8-DBB1-4889-B2D8-3F741D2958F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12 | {3698FCF8-DBB1-4889-B2D8-3F741D2958F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
13 | {3698FCF8-DBB1-4889-B2D8-3F741D2958F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
14 | {3698FCF8-DBB1-4889-B2D8-3F741D2958F5}.Release|Any CPU.Build.0 = Release|Any CPU
15 | EndGlobalSection
16 | EndGlobal
17 |
--------------------------------------------------------------------------------
/Fast-Enumerate-List/FastEnumerateList.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FastEnumerateList", "FastEnumerateList.csproj", "{8B8FFCAC-0819-4E49-860F-5104AC9FE9DC}"
4 | EndProject
5 | Global
6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
7 | Debug|Any CPU = Debug|Any CPU
8 | Release|Any CPU = Release|Any CPU
9 | EndGlobalSection
10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
11 | {8B8FFCAC-0819-4E49-860F-5104AC9FE9DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12 | {8B8FFCAC-0819-4E49-860F-5104AC9FE9DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
13 | {8B8FFCAC-0819-4E49-860F-5104AC9FE9DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
14 | {8B8FFCAC-0819-4E49-860F-5104AC9FE9DC}.Release|Any CPU.Build.0 = Release|Any CPU
15 | EndGlobalSection
16 | EndGlobal
17 |
--------------------------------------------------------------------------------
/CSharp-Dll-Export/CSharpDllExport/DoSomethings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace CSharpDllExport
5 | {
6 | public class DoSomethings
7 | {
8 | [UnmanagedCallersOnly(EntryPoint = "Add")]
9 | public static int Add(int a, int b)
10 | {
11 | return a + b;
12 | }
13 |
14 | [UnmanagedCallersOnly(EntryPoint = "ConcatString")]
15 | public static IntPtr ConcatString(IntPtr first, IntPtr second)
16 | {
17 | // 从指针转换为string
18 | string my1String = Marshal.PtrToStringAnsi(first);
19 | string my2String = Marshal.PtrToStringAnsi(second);
20 |
21 | // 连接两个string
22 | string concat = my1String + my2String;
23 |
24 | // 将申请非托管内存string转换为指针
25 | IntPtr concatPointer = Marshal.StringToHGlobalAnsi(concat);
26 |
27 | // 返回指针
28 | return concatPointer;
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/CSharp-Dll-Export/LoadLibrary.c/LoadLibrary.c.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | 源文件
20 |
21 |
22 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 InCerryGit
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Fast-Enumerate-List/Program.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.CompilerServices;
2 | using System.Runtime.InteropServices;
3 | using BenchmarkDotNet.Attributes;
4 | using BenchmarkDotNet.Running;
5 |
6 | BenchmarkRunner.Run();
7 |
8 | [MemoryDiagnoser]
9 | public class ListBenchmark
10 | {
11 | private List _list = default!;
12 |
13 | // [Params(10, 1_000, 10_000, 100_000, 1_000_000)]
14 | [Params(1000)]
15 | public int Size { get; set; }
16 |
17 | [GlobalSetup]
18 | public void Setup()
19 | {
20 | _list = new List(Size);
21 | for (var i = 0; i < Size; i++)
22 | {
23 | _list.Add(i);
24 | }
25 | }
26 |
27 | [Benchmark(Baseline = true)]
28 | public void Foreach()
29 | {
30 | foreach (var item in _list)
31 | {
32 | }
33 | }
34 |
35 | [Benchmark]
36 | public void List_Foreach()
37 | {
38 | _list.ForEach(_ => { });
39 | }
40 |
41 |
42 | [Benchmark]
43 | public void For()
44 | {
45 | for (var i = 0; i < _list.Count; i++)
46 | {
47 | _ = _list[i];
48 | }
49 | }
50 |
51 | [Benchmark]
52 | public void Foreach_Span()
53 | {
54 | foreach (var item in CollectionsMarshal.AsSpan(_list))
55 | {
56 | }
57 | }
58 |
59 | [Benchmark]
60 | public void For_Span()
61 | {
62 | var span = CollectionsMarshal.AsSpan(_list);
63 | for (int i = 0; i < span.Length; i++)
64 | {
65 | _ = span[i];
66 | }
67 | }
68 | }
--------------------------------------------------------------------------------
/CSharp-Dll-Export/LoadLibrary.c/LoadLibrary.c:
--------------------------------------------------------------------------------
1 | #define PathToLibrary "E:\\MyCode\\BlogCodes\\CSharp-Dll-Export\\CSharpDllExport\\CSharpDllExport\\bin\\Release\\net7.0\\win-x64\\publish\\CSharpDllExport.dll"
2 |
3 | // 导入必要的头文件
4 | #include
5 | #include
6 | #include
7 |
8 | int callAddFunc(char* path, char* funcName, int a, int b);
9 | char* callConcatStringFunc(char* path, char* funcName, char* firstString, char* secondString);
10 |
11 | int main()
12 | {
13 | // 检查文件是否存在
14 | if (access(PathToLibrary, 0) == -1)
15 | {
16 | puts("没有在指定的路径找到库文件");
17 | return 0;
18 | }
19 |
20 | // 计算两个值的和
21 | int sum = callAddFunc(PathToLibrary, "Add", 2, 8);
22 | printf("两个值的和是 %d \n", sum);
23 |
24 | // 拼接两个字符串
25 | char* result = callConcatStringFunc(PathToLibrary, "ConcatString", ".NET", " yyds");
26 | printf("拼接字符串的结果为 %s \n", result);
27 | }
28 |
29 | int callAddFunc(char* path, char* funcName, int firstInt, int secondInt)
30 | {
31 | // 调用 C# 共享库的函数来计算两个数的和
32 | HINSTANCE handle = LoadLibraryA(path);
33 |
34 | typedef int(*myFunc)(int, int);
35 | myFunc MyImport = (myFunc)GetProcAddress(handle, funcName);
36 |
37 | int result = MyImport(firstInt, secondInt);
38 |
39 | return result;
40 | }
41 |
42 | char* callConcatStringFunc(char* path, char* funcName, char* firstString, char* secondString)
43 | {
44 |
45 | HINSTANCE handle = LoadLibraryA(path);
46 | typedef char* (*myFunc)(char*, char*);
47 |
48 | myFunc MyImport = (myFunc)GetProcAddress(handle, funcName);
49 |
50 | // 传递指针并且返回指针
51 | char* result = MyImport(firstString, secondString);
52 |
53 | return result;
54 | }
--------------------------------------------------------------------------------
/Get-GC-STW-Time/Program.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.Tracing;
2 |
3 | // 开启GC事件监听
4 | var gc = new GcStwMetricsCollector();
5 | // 创建一些对象
6 | var array = Enumerable.Range(0, 1000).Select(s => (decimal)s).ToArray();
7 | // 手动执行GC
8 | GC.Collect();
9 | Console.WriteLine($"API STW:{GC.GetTotalPauseDuration().TotalMilliseconds}ms");
10 | Console.ReadLine();
11 |
12 | public class GcStwMetricsCollector : EventListener
13 | {
14 | // GC关键字
15 | private const int GC_KEYWORD = 0x0000001;
16 |
17 | // 我们要关注的GC事件
18 | private const int GCSuspendEEBegin = 8;
19 | private const int GCRestartEEEnd = 3;
20 |
21 | private EventSource? _eventSource;
22 |
23 | public void Stop()
24 | {
25 | if (_eventSource == null)
26 | return;
27 |
28 | DisableEvents(_eventSource);
29 | }
30 |
31 | protected override void OnEventSourceCreated(EventSource eventSource)
32 | {
33 | _eventSource = eventSource;
34 | // GC 事件在 Microsoft-Windows-DotNETRuntime 名称空间下
35 | if (eventSource.Name.Equals("Microsoft-Windows-DotNETRuntime"))
36 | {
37 | // 启用事件,事件级别为Informational, 只监听GC事件
38 | EnableEvents(eventSource, EventLevel.Informational, (EventKeywords) (GC_KEYWORD));
39 | }
40 | }
41 |
42 |
43 | private long _currentStwStartTime = 0;
44 |
45 | protected override void OnEventWritten(EventWrittenEventArgs e)
46 | {
47 | switch (e.EventId)
48 | {
49 | // 冻结托管线程开始,记录当前时间
50 | case GCSuspendEEBegin:
51 | _currentStwStartTime = e.TimeStamp.Ticks;
52 | break;
53 |
54 | // 恢复托管线程结束,计算当前时间与冻结托管线程开始时间的差值
55 | case GCRestartEEEnd:
56 | if (_currentStwStartTime > 0)
57 | {
58 | var ms = TimeSpan.FromTicks(e.TimeStamp.Ticks - _currentStwStartTime).TotalMilliseconds;
59 | _currentStwStartTime = 0;
60 | // 输出结果
61 | Console.WriteLine($"Event STW: {ms}ms");
62 | }
63 | break;
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/Use-SourceGenerator-Logger/Program.cs:
--------------------------------------------------------------------------------
1 | #define Benchmark
2 |
3 | using BenchmarkDotNet.Attributes;
4 | using BenchmarkDotNet.Order;
5 | using BenchmarkDotNet.Running;
6 | using Microsoft.Extensions.Logging;
7 |
8 | #if Benchmark
9 | _ = BenchmarkRunner.Run();
10 |
11 | [HtmlExporter]
12 | [MemoryDiagnoser]
13 | [Orderer(SummaryOrderPolicy.FastestToSlowest)]
14 | public class Benchmark
15 | {
16 | private static readonly ILogger Logger = new EmptyLogger();
17 | private readonly OrderLogger _orderLogger = new(Logger);
18 | private readonly Member _user = new("8888","Justin Yu");
19 | private readonly DateTime _now = DateTime.UtcNow;
20 |
21 | [Benchmark]
22 | public void LogByStringInterpolation() => _orderLogger.LogByStringInterpolation(_user, _now);
23 |
24 | [Benchmark]
25 | public void LogByStructure() => _orderLogger.LogByStructure(_user, _now);
26 |
27 | [Benchmark]
28 | public void LogBySourceGenerator() => OrderLogger.LogBySourceGenerator(Logger, _user, _now);
29 | }
30 | #else
31 |
32 | var logger = LoggerFactory.Create(l => l.AddConsole()).CreateLogger(typeof(OrderLogger));
33 | var orderLogger = new OrderLogger(logger);
34 | var member = new Member("8888","Justin Yu");
35 | orderLogger.LogByStringInterpolation(member, DateTime.Now);
36 | orderLogger.LogByStructure(member, DateTime.Now);
37 | OrderLogger.LogBySourceGenerator(logger, member, DateTime.Now);
38 |
39 | #endif
40 |
41 | ///
42 | /// 订单日志记录类
43 | ///
44 | public partial class OrderLogger
45 | {
46 | private readonly ILogger _logger;
47 |
48 | public OrderLogger(ILogger logger)
49 | {
50 | _logger = logger;
51 | }
52 |
53 | ///
54 | /// 字符串插值
55 | ///
56 | public void LogByStringInterpolation(Member member, DateTime now)=>
57 | _logger.LogInformation($"会员[{member}]在[{now:yyyy-MM-dd HH:mm:ss}]充值了一个小目标");
58 |
59 | ///
60 | /// 参数化
61 | ///
62 | public void LogByStructure(Member member, DateTime now) =>
63 | _logger.LogInformation("会员[{Member}]在[{Now:yyyy-MM-dd HH:mm:ss}]充值了一个小目标", member, now);
64 |
65 | ///
66 | /// 源代码生成
67 | ///
68 | [LoggerMessage(
69 | EventId = 0,
70 | Level = LogLevel.Information,
71 | Message = "会员[{member}]在[{Now:yyyy-MM-dd HH:mm:ss}]充值了一个小目标")]
72 | public static partial void LogBySourceGenerator(ILogger logger, Member member, DateTime now);
73 | }
74 |
75 | ///
76 | /// 会员
77 | ///
78 | /// 会员Id
79 | /// 会员名
80 | public record Member(string MemberId, string Name);
81 |
82 | public class EmptyLogger : ILogger
83 | {
84 | public void Log(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter)
85 | { }
86 |
87 | public bool IsEnabled(LogLevel logLevel) => true;
88 |
89 | public IDisposable BeginScope(TState state) => default;
90 | }
--------------------------------------------------------------------------------
/CSharp-Dll-Export/CSharpDllExport.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.3.32825.248
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpDllExport", "CSharpDllExport\CSharpDllExport.csproj", "{118D6389-A05F-49C8-B423-9A3B2BB7AC71}"
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LoadLibrary", "LoadLibrary.c\LoadLibrary.c.vcxproj", "{E14774D1-AA4F-49AA-BF00-C76A5E2D6C35}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Debug|x64 = Debug|x64
14 | Debug|x86 = Debug|x86
15 | Release|Any CPU = Release|Any CPU
16 | Release|x64 = Release|x64
17 | Release|x86 = Release|x86
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {118D6389-A05F-49C8-B423-9A3B2BB7AC71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {118D6389-A05F-49C8-B423-9A3B2BB7AC71}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {118D6389-A05F-49C8-B423-9A3B2BB7AC71}.Debug|x64.ActiveCfg = Debug|Any CPU
23 | {118D6389-A05F-49C8-B423-9A3B2BB7AC71}.Debug|x64.Build.0 = Debug|Any CPU
24 | {118D6389-A05F-49C8-B423-9A3B2BB7AC71}.Debug|x86.ActiveCfg = Debug|Any CPU
25 | {118D6389-A05F-49C8-B423-9A3B2BB7AC71}.Debug|x86.Build.0 = Debug|Any CPU
26 | {118D6389-A05F-49C8-B423-9A3B2BB7AC71}.Release|Any CPU.ActiveCfg = Release|Any CPU
27 | {118D6389-A05F-49C8-B423-9A3B2BB7AC71}.Release|Any CPU.Build.0 = Release|Any CPU
28 | {118D6389-A05F-49C8-B423-9A3B2BB7AC71}.Release|x64.ActiveCfg = Release|Any CPU
29 | {118D6389-A05F-49C8-B423-9A3B2BB7AC71}.Release|x64.Build.0 = Release|Any CPU
30 | {118D6389-A05F-49C8-B423-9A3B2BB7AC71}.Release|x86.ActiveCfg = Release|Any CPU
31 | {118D6389-A05F-49C8-B423-9A3B2BB7AC71}.Release|x86.Build.0 = Release|Any CPU
32 | {E14774D1-AA4F-49AA-BF00-C76A5E2D6C35}.Debug|Any CPU.ActiveCfg = Debug|x64
33 | {E14774D1-AA4F-49AA-BF00-C76A5E2D6C35}.Debug|Any CPU.Build.0 = Debug|x64
34 | {E14774D1-AA4F-49AA-BF00-C76A5E2D6C35}.Debug|x64.ActiveCfg = Debug|x64
35 | {E14774D1-AA4F-49AA-BF00-C76A5E2D6C35}.Debug|x64.Build.0 = Debug|x64
36 | {E14774D1-AA4F-49AA-BF00-C76A5E2D6C35}.Debug|x86.ActiveCfg = Debug|Win32
37 | {E14774D1-AA4F-49AA-BF00-C76A5E2D6C35}.Debug|x86.Build.0 = Debug|Win32
38 | {E14774D1-AA4F-49AA-BF00-C76A5E2D6C35}.Release|Any CPU.ActiveCfg = Release|x64
39 | {E14774D1-AA4F-49AA-BF00-C76A5E2D6C35}.Release|Any CPU.Build.0 = Release|x64
40 | {E14774D1-AA4F-49AA-BF00-C76A5E2D6C35}.Release|x64.ActiveCfg = Release|x64
41 | {E14774D1-AA4F-49AA-BF00-C76A5E2D6C35}.Release|x64.Build.0 = Release|x64
42 | {E14774D1-AA4F-49AA-BF00-C76A5E2D6C35}.Release|x86.ActiveCfg = Release|Win32
43 | {E14774D1-AA4F-49AA-BF00-C76A5E2D6C35}.Release|x86.Build.0 = Release|Win32
44 | EndGlobalSection
45 | GlobalSection(SolutionProperties) = preSolution
46 | HideSolutionNode = FALSE
47 | EndGlobalSection
48 | GlobalSection(ExtensibilityGlobals) = postSolution
49 | SolutionGuid = {12B19A32-ED5A-43F2-872C-1B04F0B669FC}
50 | EndGlobalSection
51 | EndGlobal
52 |
--------------------------------------------------------------------------------
/CSharp-Dll-Export/LoadLibrary.c/LoadLibrary.c.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 | Debug
14 | x64
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 | 16.0
23 | Win32Proj
24 | {e14774d1-aa4f-49aa-bf00-c76a5e2d6c35}
25 | LoadLibraryc
26 | 10.0
27 | LoadLibrary
28 |
29 |
30 |
31 | Application
32 | true
33 | v143
34 | Unicode
35 |
36 |
37 | Application
38 | false
39 | v143
40 | true
41 | Unicode
42 |
43 |
44 | Application
45 | true
46 | v143
47 | Unicode
48 |
49 |
50 | Application
51 | false
52 | v143
53 | true
54 | Unicode
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | Level3
77 | true
78 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
79 | true
80 |
81 |
82 | Console
83 | true
84 |
85 |
86 |
87 |
88 | Level3
89 | true
90 | true
91 | true
92 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
93 | true
94 |
95 |
96 | Console
97 | true
98 | true
99 | true
100 |
101 |
102 |
103 |
104 | Level3
105 | true
106 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
107 | true
108 |
109 |
110 | Console
111 | true
112 |
113 |
114 |
115 |
116 | Level3
117 | true
118 | true
119 | true
120 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
121 | true
122 |
123 |
124 | Console
125 | true
126 | true
127 | true
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Aa][Rr][Mm]/
27 | [Aa][Rr][Mm]64/
28 | bld/
29 | [Bb]in/
30 | [Oo]bj/
31 | [Ll]og/
32 | [Ll]ogs/
33 |
34 | # Visual Studio 2015/2017 cache/options directory
35 | .vs/
36 | # Uncomment if you have tasks that create the project's static files in wwwroot
37 | #wwwroot/
38 |
39 | # Visual Studio 2017 auto generated files
40 | Generated\ Files/
41 |
42 | # MSTest test Results
43 | [Tt]est[Rr]esult*/
44 | [Bb]uild[Ll]og.*
45 |
46 | # NUnit
47 | *.VisualState.xml
48 | TestResult.xml
49 | nunit-*.xml
50 |
51 | # Build Results of an ATL Project
52 | [Dd]ebugPS/
53 | [Rr]eleasePS/
54 | dlldata.c
55 |
56 | # Benchmark Results
57 | BenchmarkDotNet.Artifacts/
58 |
59 | # .NET Core
60 | project.lock.json
61 | project.fragment.lock.json
62 | artifacts/
63 |
64 | # StyleCop
65 | StyleCopReport.xml
66 |
67 | # Files built by Visual Studio
68 | *_i.c
69 | *_p.c
70 | *_h.h
71 | *.ilk
72 | *.meta
73 | *.obj
74 | *.iobj
75 | *.pch
76 | *.pdb
77 | *.ipdb
78 | *.pgc
79 | *.pgd
80 | *.rsp
81 | *.sbr
82 | *.tlb
83 | *.tli
84 | *.tlh
85 | *.tmp
86 | *.tmp_proj
87 | *_wpftmp.csproj
88 | *.log
89 | *.vspscc
90 | *.vssscc
91 | .builds
92 | *.pidb
93 | *.svclog
94 | *.scc
95 |
96 | # Chutzpah Test files
97 | _Chutzpah*
98 |
99 | # Visual C++ cache files
100 | ipch/
101 | *.aps
102 | *.ncb
103 | *.opendb
104 | *.opensdf
105 | *.sdf
106 | *.cachefile
107 | *.VC.db
108 | *.VC.VC.opendb
109 |
110 | # Visual Studio profiler
111 | *.psess
112 | *.vsp
113 | *.vspx
114 | *.sap
115 |
116 | # Visual Studio Trace Files
117 | *.e2e
118 |
119 | # TFS 2012 Local Workspace
120 | $tf/
121 |
122 | # Guidance Automation Toolkit
123 | *.gpState
124 |
125 | # ReSharper is a .NET coding add-in
126 | _ReSharper*/
127 | *.[Rr]e[Ss]harper
128 | *.DotSettings.user
129 |
130 | # TeamCity is a build add-in
131 | _TeamCity*
132 |
133 | # DotCover is a Code Coverage Tool
134 | *.dotCover
135 |
136 | # AxoCover is a Code Coverage Tool
137 | .axoCover/*
138 | !.axoCover/settings.json
139 |
140 | # Visual Studio code coverage results
141 | *.coverage
142 | *.coveragexml
143 |
144 | # NCrunch
145 | _NCrunch_*
146 | .*crunch*.local.xml
147 | nCrunchTemp_*
148 |
149 | # MightyMoose
150 | *.mm.*
151 | AutoTest.Net/
152 |
153 | # Web workbench (sass)
154 | .sass-cache/
155 |
156 | # Installshield output folder
157 | [Ee]xpress/
158 |
159 | # DocProject is a documentation generator add-in
160 | DocProject/buildhelp/
161 | DocProject/Help/*.HxT
162 | DocProject/Help/*.HxC
163 | DocProject/Help/*.hhc
164 | DocProject/Help/*.hhk
165 | DocProject/Help/*.hhp
166 | DocProject/Help/Html2
167 | DocProject/Help/html
168 |
169 | # Click-Once directory
170 | publish/
171 |
172 | # Publish Web Output
173 | *.[Pp]ublish.xml
174 | *.azurePubxml
175 | # Note: Comment the next line if you want to checkin your web deploy settings,
176 | # but database connection strings (with potential passwords) will be unencrypted
177 | *.pubxml
178 | *.publishproj
179 |
180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
181 | # checkin your Azure Web App publish settings, but sensitive information contained
182 | # in these scripts will be unencrypted
183 | PublishScripts/
184 |
185 | # NuGet Packages
186 | *.nupkg
187 | # NuGet Symbol Packages
188 | *.snupkg
189 | # The packages folder can be ignored because of Package Restore
190 | **/[Pp]ackages/*
191 | # except build/, which is used as an MSBuild target.
192 | !**/[Pp]ackages/build/
193 | # Uncomment if necessary however generally it will be regenerated when needed
194 | #!**/[Pp]ackages/repositories.config
195 | # NuGet v3's project.json files produces more ignorable files
196 | *.nuget.props
197 | *.nuget.targets
198 |
199 | # Microsoft Azure Build Output
200 | csx/
201 | *.build.csdef
202 |
203 | # Microsoft Azure Emulator
204 | ecf/
205 | rcf/
206 |
207 | # Windows Store app package directories and files
208 | AppPackages/
209 | BundleArtifacts/
210 | Package.StoreAssociation.xml
211 | _pkginfo.txt
212 | *.appx
213 | *.appxbundle
214 | *.appxupload
215 |
216 | # Visual Studio cache files
217 | # files ending in .cache can be ignored
218 | *.[Cc]ache
219 | # but keep track of directories ending in .cache
220 | !?*.[Cc]ache/
221 |
222 | # Others
223 | ClientBin/
224 | ~$*
225 | *~
226 | *.dbmdl
227 | *.dbproj.schemaview
228 | *.jfm
229 | *.pfx
230 | *.publishsettings
231 | orleans.codegen.cs
232 |
233 | # Including strong name files can present a security risk
234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
235 | #*.snk
236 |
237 | # Since there are multiple workflows, uncomment next line to ignore bower_components
238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
239 | #bower_components/
240 |
241 | # RIA/Silverlight projects
242 | Generated_Code/
243 |
244 | # Backup & report files from converting an old project file
245 | # to a newer Visual Studio version. Backup files are not needed,
246 | # because we have git ;-)
247 | _UpgradeReport_Files/
248 | Backup*/
249 | UpgradeLog*.XML
250 | UpgradeLog*.htm
251 | ServiceFabricBackup/
252 | *.rptproj.bak
253 |
254 | # SQL Server files
255 | *.mdf
256 | *.ldf
257 | *.ndf
258 |
259 | # Business Intelligence projects
260 | *.rdl.data
261 | *.bim.layout
262 | *.bim_*.settings
263 | *.rptproj.rsuser
264 | *- [Bb]ackup.rdl
265 | *- [Bb]ackup ([0-9]).rdl
266 | *- [Bb]ackup ([0-9][0-9]).rdl
267 |
268 | # Microsoft Fakes
269 | FakesAssemblies/
270 |
271 | # GhostDoc plugin setting file
272 | *.GhostDoc.xml
273 |
274 | # Node.js Tools for Visual Studio
275 | .ntvs_analysis.dat
276 | node_modules/
277 |
278 | # Visual Studio 6 build log
279 | *.plg
280 |
281 | # Visual Studio 6 workspace options file
282 | *.opt
283 |
284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
285 | *.vbw
286 |
287 | # Visual Studio LightSwitch build output
288 | **/*.HTMLClient/GeneratedArtifacts
289 | **/*.DesktopClient/GeneratedArtifacts
290 | **/*.DesktopClient/ModelManifest.xml
291 | **/*.Server/GeneratedArtifacts
292 | **/*.Server/ModelManifest.xml
293 | _Pvt_Extensions
294 |
295 | # Paket dependency manager
296 | .paket/paket.exe
297 | paket-files/
298 |
299 | # FAKE - F# Make
300 | .fake/
301 |
302 | # CodeRush personal settings
303 | .cr/personal
304 |
305 | # Python Tools for Visual Studio (PTVS)
306 | __pycache__/
307 | *.pyc
308 |
309 | # Cake - Uncomment if you are using it
310 | # tools/**
311 | # !tools/packages.config
312 |
313 | # Tabs Studio
314 | *.tss
315 |
316 | # Telerik's JustMock configuration file
317 | *.jmconfig
318 |
319 | # BizTalk build output
320 | *.btp.cs
321 | *.btm.cs
322 | *.odx.cs
323 | *.xsd.cs
324 |
325 | # OpenCover UI analysis results
326 | OpenCover/
327 |
328 | # Azure Stream Analytics local run output
329 | ASALocalRun/
330 |
331 | # MSBuild Binary and Structured Log
332 | *.binlog
333 |
334 | # NVidia Nsight GPU debugger configuration file
335 | *.nvuser
336 |
337 | # MFractors (Xamarin productivity tool) working folder
338 | .mfractor/
339 |
340 | # Local History for Visual Studio
341 | .localhistory/
342 |
343 | # BeatPulse healthcheck temp database
344 | healthchecksdb
345 |
346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
347 | MigrationBackup/
348 |
349 | # Ionide (cross platform F# VS Code tools) working folder
350 | .ionide/
351 | /.idea
352 | /*/.idea/
353 |
--------------------------------------------------------------------------------