Skip to content

The Dummy Programmer

Stories of daily programming

  • Home
  • My other dummy projects
  • Games
    • Space Y: An Asteroids clone
  • Services
    • What’s my user agent
    • What’s my IP address
  • About
  • Toggle search form

Category: C#

Is Environment.TickCount reliable?

Hello my friends! Today I want to talk about some problems encountered using the property Environment.TickCount, available since the version 1.1 of .NET Framework. In a nutshell, this property tells you how many milliseconds elapsed since system boot. Why did I have to use it? During the development of TDP Robot, that I remind you…

Read More “Is Environment.TickCount reliable?” »

C#

C# async / await behind the scenes

Good morning to everyone! I’m sure you already know C#’s async / await keywords and the benefit of asynchronous programming in real world. In my blog we already talked about them in these posts: Working with C# async / await keywords (part 1 of 3) Working with C# async / await keywords (part 2 of…

Read More “C# async / await behind the scenes” »

C#

Telerik RadGrid’s pagination hangs

Today I want to talk you about a problem I faced in these last days working on a ASP.NET web form project. In this project I used the library “UI for ASP.NET AJAX” from Telerik, and in particular the problem occurred using the RadGrid control. What was the problem? In a nutshell, without an explanation,…

Read More “Telerik RadGrid’s pagination hangs” »

ASP.NET

Could not load file or assembly ‘DocumentFormat.OpenXml, Version=2.7.2.0

I’m developing a C# application which uses the library ClosedXML in order to generate XLSX files, and I ran into this error: “Could not load file or assembly ‘DocumentFormat.OpenXml, Version=2.7.2.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17’ or one of its dependencies. The system cannot find the file specified.File name: ‘DocumentFormat.OpenXml, Version=2.7.2.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17′”. It’s weird, because in my development…

Read More “Could not load file or assembly ‘DocumentFormat.OpenXml, Version=2.7.2.0” »

C#

System.Net.Sockets.SocketException (0x80004005): No such host is known

I was working on an old ASP.NET application written in C#, which uses the following method to code to get the IP address of the server it runs on: Apart from the doubt about the correctness of the code to obtain the IP address of the machine, at the line with the call to “Dns.GetHostEntry”,…

Read More “System.Net.Sockets.SocketException (0x80004005): No such host is known” »

ASP.NET

Reading data from a NetworkStream object in C#

Good morning folks! In this post I want to talk about a bug I discovered in my TDP.BaseServices library, which I remember you can download here. This bug prevented from properly deserializing objects I sent through the NetworkStream object. The problem was in the way I read data from a NetworkStream object. If you browse…

Read More “Reading data from a NetworkStream object in C#” »

C#

Working with C# async / await keywords (part 3 of 3)

In previous posts we talked about how use the Task object, async / await keywords and how to cancel a running task. In this last post I want to talk about another important point regarding task management: exception handling. We will resume the example program created in the first post, which you can download here….

Read More “Working with C# async / await keywords (part 3 of 3)” »

C#

Working with C# async / await keywords (part 2 of 3)

In the previous post we saw some use cases of the Task object and the async / await keywords. We saw how we can run two long tasks, one dependent on the other, without blocking the main thread and the user interface. In our example we used an async event handler, which is marked with…

Read More “Working with C# async / await keywords (part 2 of 3)” »

C#

Working with C# async / await keywords (part 1 of 3)

Introduced with C# 5.0, the async / await pattern was born with the intention of simplifying asynchronous programming. You can find these keywords in many programming language, but in this post we will specifically talk about C#’s implementation. Let’s start by creating a simple Windows Forms applications to do some tests (click here to download…

Read More “Working with C# async / await keywords (part 1 of 3)” »

C#

Make user interface calls in thread safe way in Windows Forms

If you are working on a Windows Forms project and you are using threads in some way, by accessing the controls from a thread other than the main one, you may have received this error message: System.InvalidOperationException: ‘Cross-thread operation not valid: Control ‘TxtCounter1′ accessed from a thread other than the thread it was created on.’…

Read More “Make user interface calls in thread safe way in Windows Forms” »

C#

Posts pagination

1 2 Next

Copyright © 2024 The Dummy Programmer | Privacy Policy | Terms of use |

Powered by PressBook Masonry Dark

Manage Cookie Consent
This site doesn’t collect user personal data and doesn’t install profiling or analytical cookies, either its own or from third parties. Read our privacy policy for more info.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
View preferences
{title} {title} {title}