Фатальный ошибка. System.accessviolationException: попытка прочитать или написать защищенную память. Это часто указывает на то, что другая память повреждена.
at System.Runtime.Interopservices.marshal.ispinnable (System.Object)
at system.runtime.interopservices.gchandle..ctor (System.Object, System.Runtime.InterOpservices.gchandletype)
at System.Runtime.InterOpservices.gchandle.alloc (System.Object, System.Runtime.InterOpservices.GchandleType)
at themis.las.stream.asyncstreamhandler.marshalpoints (br /> Themis.las.stream.istreambuffer)
at themis.las.stream.asyncstreamhandler.readpointsasync () < /p>
my code: < /p>
Код: Выделить всё
using System;
using Themis.Las;
class Program
{
static void Main(string[] args)
{
string lasFilePath = @"C:\Users\mjau\Desktop\LazFileReader\lidarData.las";
try
{
using var reader = new LasReader(lasFilePath);
var lpt = new LasPoint();
int counter = 0;
Console.WriteLine($"Reading LAS file: {lasFilePath}");
while (!reader.EOF)
{
reader.GetNextPoint(ref lpt);
Console.WriteLine($"Point {counter + 1}: X={lpt.X}, Y={lpt.Y}, Z={lpt.Z}");
counter++;
}
}
catch (Exception ex)
{
Console.WriteLine($"Critical Error: {ex.Message}");
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/794 ... s-with-c-s
Мобильная версия