Fix some small issues and experiment with C#
This commit is contained in:
19
examples/cs/My/MyClass.cs
Normal file
19
examples/cs/My/MyClass.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using OtherNamespace;
|
||||
|
||||
namespace MyNamespace {
|
||||
public class MyClass {
|
||||
// This method will be called by native code inside the target process…
|
||||
public static int MyMethod(String pwzArgument) {
|
||||
System.Console.WriteLine("Hello World from C# {0}", pwzArgument);
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void Main() {
|
||||
int my = MyMethod("from Main()");
|
||||
System.Console.WriteLine("MyMethod returned {0}", my);
|
||||
int other = OtherNamespace.OtherClass.OtherMethod();
|
||||
System.Console.WriteLine("OtherMethod returned {0}", other);
|
||||
}
|
||||
}
|
||||
}
|
10
examples/cs/My/MyClass.csproj
Normal file
10
examples/cs/My/MyClass.csproj
Normal file
@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<OutputType>Exe</OutputType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Other\OtherClass.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
Reference in New Issue
Block a user