C#/ASP/DotNet force compiler errors display in English
Set environmental variable:
|
1 |
DOTNET_CLI_UI_LANGUAGE="en" |
Set environmental variable:
|
1 |
DOTNET_CLI_UI_LANGUAGE="en" |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
[DllImport("kernel32.dll")] static extern IntPtr GetConsoleWindow(); [DllImport("user32.dll")] static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); [DllImport("kernel32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] static extern bool AllocConsole(); const int SW_HIDE = 0; const int SW_SHOW = 5; void test(){ AllocConsole(); // create console ShowWindow(GetConsoleWindow(), SW_HIDE); // hide console } |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
{ // ZAPIS // var h5file = H5F.create("modfem.h5", H5F.CreateMode.ACC_TRUNC); var dspace = H5S.create_simple(1, new long[] {5}); var dtype = H5T.H5Type.IEEE_F64LE; H5GroupId groupId = H5G.create(h5file, "Results"); H5GroupId subGroup = H5G.create(groupId, "Step#0"); var dset = H5D.create(subGroup, "Temperature", dtype, dspace); var tid = H5T.copy(dtype); H5Array<float> array = new H5Array<float>(new float[] {10, 20, 30, 40, 50}); H5D.write(dset, tid, array); H5F.close(h5file); } { // ODCZYT // var h5file = H5F.open("modfem.h5", H5F.OpenMode.ACC_RDWR); var dtype = H5T.H5Type.IEEE_F64LE; var resultGroup = H5G.open(h5file, "Results"); var stepGroup = H5G.open(resultGroup, "Step#0"); var tempDataSet = H5D.open(stepGroup, "Temperature"); var space = H5D.getSpace(tempDataSet); var dims = H5S.getSimpleExtentDims(space); var dataType = H5D.getType(tempDataSet); float[] dataArray = new float[dims[0]]; var wrapArray = new H5Array<float>(dataArray); H5D.read(tempDataSet, dataType, wrapArray); H5F.close(h5file); } |