• /r/csharp
  • How to write a Web API endpoint that takes file content as arraybuffer?

    This is how I am POSTing the file from client: function upload(file) { var reader = new FileReader(); reader.onloadend = function (e) { var buffer = e.target.result; ajax(buffer, file); }; reader.readAsArrayBuffer(file); } function ajax(buffer, file) { let oReq = new XMLHttpRequest(); oReq.open(‘PUT’, ‘/api/files/upload’ + file.name, true); oReq.onload = function(e) { if (oReq.status >= 200 && […]

  • /r/csharp
  • New to C# – parsing

    So I am new to C# and I am currently learning the basics in the console. So, my simple question is why can we parse numbers like this: double a = double.Parse(Console.ReadLine()); but I can’t use var.Parse for this .. var name = Console.ReadLine(); I tried changing var name to string name and use string.Parse […]

  • /r/csharp
  • System.Net.Http.Handlers.ProgressMessageHandler not working as expected

    I am hoping someone here has experiencing with ProgressMessage Handler. I am using it in a Xamarin app to display progress of uploads and downloads, but it’s not quite working as expected. It doesn’t seem to fire HttpReceiveProgress at all when calling client.GetAsync(). When calling client.PostAsync(), it only fires HttpSendProgress once, with the complete size […]

  • /r/csharp
  • Packaging fonts in your .exe?

    I’m new to C# and .Net dev. I’m developing some new software for work and was wondering how external fonts and packages are handled on other systems. If I download an external font and use it in my project, how does another user from a different computer obtain this same font? submitted by /u/MinimalistKid [link] […]

  • /r/csharp
  • Need reading recommendations

    I’ve been tracing errors and debugging for almost two years now. Where can I read up on how to plan and design decent sized applications and add major features? For example materials on how to organize a project a certain way to avoid hard coupling and makes the classes more testable or how to organize […]