c#

c#

c# – Help me fix the error

Question: There is an object that inherits from IEnumerable . In MoveNext method of this class, a StackOverflowException occurs on the line with Regex . The regular expression itself looks for text matches in files. Remarkably, everything works on Windows 10 x64 with .Net 4.6, the error occurs on Windows …

c# – Help me fix the error Read More »

c# – Atomicity of the operation of obtaining an instance of a class on an x64 application

Question: Assignment atomicity can be achieved with System.Threading.Interlocked Interlocked.Exchange(ref toItem, fromItem); But how to get an instance of a class atomically, because System.Threading.Interlocked does not have a Read(ref object) method, there is only Read(ref long) ? TObject obj = somethingObject; //Сомнение атомарности. //Поскольку передача указателя x64 не умещается в такт …

c# – Atomicity of the operation of obtaining an instance of a class on an x64 application Read More »

c# – Client Web API in Windows Forms

Question: I'm making a client using Web Api. My site has the Web Api server role. I found this Microsoft reference http://www.asp.net/web-api/overview/web-api-clients/calling-a-web-api-from-a-net-client which has an example client: static async Task RunAsync() { using (var client = new HttpClient()) { client.BaseAddress = new Uri(“http://localhost:9000/”); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(“application/json”)); // HTTP GET HttpResponseMessage …

c# – Client Web API in Windows Forms Read More »

Scroll to Top