Keep it Simple

// practice, the distance between dream and achievement

Tag: Development (page 1 of 8)

So what is lock in C#?

Lock, a keyword, that protect the state of the object is being locked means that the state of the object can not be modified outside of the lock until it is released.

This is used in threading, it restricts code from being executed by more than one thread at the same time. This makes threaded programs reliable. The lock statement uses a special syntax form to restrict concurrent access.

Continue reading

SSL – Underlying connection was closed

If you’ve ever had to make a web request to an HTTPS endpoint from C# you will likely run into this gem of an exception.

The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

Who the what now?

Continue reading

Download images from a URL in C#

You may use the following method to retrieve the image from a specific URL on the web. The below C# function takes an image url, download the image from the url as a stream.

Continue reading

Why to use partial class?

It splits the definition of a class over two or more source files. You can create a class definition in multiple files but it will be compiled as one class.

1

Continue reading

Older posts

© 2017 Keep it Simple

Theme by Anders NorenUp ↑