Follow us on X (Twitter)  Like us on Facebook  Connect with us on LinkedIn  Subscribe to our YouTube Channel  Subscribe to our WhatsApp Group

CSharp

Showing posts with label CSharp. Show all posts

If you are building a custom installer of your own, you might want to compress the files inside a ZIP and extract them on need basis. You can easily do this by using some 3rd party libraries, among which some are free and some are paid versions. Why to use additional libraries if the .NET framework provides you the set of APIs?

 

You might be aware of this, but if you are unaware of it, let me tell you that, it was present since .NET 2.0. Let’s explore it in today’s quick blog tips & tricks. Continue reading and share the link in your network.

Published by on under .Net | C#

If you are working with XML serialization in .NET/C#, you might have already encountered this and might have analyzed a lot why your data is not serializing though you have written proper code. The reason/solution might be simple but in case you are not aware of such common mistakes, you will definitely break your head finding the root cause.

 

In this quick post, we will learn about the common mistakes that may happen while declaring the properties of data class that you are going to serialize. Continue reading and let me know, if you find more points to be added here.

Published by on under .Net | C#

In most cases, we use XML files to serialize/de-serialize data from/to the app. To do this, we expose properties of known types and pass them to the serializer for the automatic serialization process. Sometimes, we don’t need to serialize all the properties and manually need to mark them from the serialization process.

 

In this small blog post, we are going to see the way, by which you can prevent a property from the XML serialization process. Continue reading to know more.

Published by on under .Net | C#

Not every system has the right folder permission set to all user account and hence, sometime we need special access to specific folder during installation or while executing the application. It is not possible to manually set it up by browsing the folder and hence an automation is mandatory.

 

If you are looking for a way to set the right permission to specific folder(s) using C# code, this post will help you. Continue reading to learn more about it and grab the code.

Published by on under .Net | C#

Registry is the heart of Windows Operating System and all/most of the apps and games associates various values/data into the registry, which can be accessed at different point of time. Playing with Windows registry is very dangerous and hence general people should avoid or take special care while working with it.

 

In case you are a developer, you want to read/write/delete entries to/fro Windows Registry. This post will cover details and code snippets to delete an entire key tree from it. Continue reading to learn how to do it.

Published by on under .Net | C#

Sometime we need to find out details of running process which is external to your current process, might be a third party one. If you are currently looking for some code to find out details of a process, this post will definitely help you. Here we will learn, how to get the process description using C#.

 

Continue reading to learn about it. Also, sample code has been shared for you to understand it better. If you have specific query, drop a line in the comment section.

Published by on under .Net | C#

When downloading from a remote location, many time we need to know whether the file downloaded properly or not. There are many techniques to know about it but among them, one of the approach is to check the hash value of the file. The Cryptography APIs of .NET can help you to calculate the same.

 

Today in this post, we will learn how to calculate the hash value of file stored in local resource. Continue reading to learn more about the steps. Code has been shared.

Published by on under .Net | C#

Most of the developers in the Microsoft platform uses C# as their programming language. C# is now matured to version 6 and has come with new features in its different versions. As a programmer, we should know all these features. This will not only help you in cracking interviews but also help you decide whether you should upgrade your project to latest.

Published by on under .Net | C# 4.0

Let’s come to basics of programming today. It’s a common interview question asked during an interview and many time candidates become confused with the difference between using directive and using statement/block. Today we will cover this topic and discuss various difference among those.

 

To learn or brush up the basic concepts, continue reading more. I hope, this will clarify all your doubts. If any feedback, do share below in the comments section.

Published by on under .Net | CSharp

Many time we need to programmatically retrieve the size of a file before downloading it from a web location or a network path. This is require to calculate the progress and/or the estimated time to download and display it to the user. For a local file it is easy, but to retrieve this information from a remote location, the implementation is little different.

 

Today in this small blog post, we will learn how to retrieve it dynamically using C# code. Continue reading to know about it. Code snippet has been shared in the post.

Published by on under .Net | CSharp

This could be one of the issue you might face while using service call or HTTP Post to server. Though this issue rarely happens but in case you encounter such error in your production, possibility is your client application is facing issue connecting to the server due to proxy server.

 

If you come across such issue, this quick blog post will help you to resolve it. You don’t need to do much, but just a configuration settings will help you.

Published by on under .Net | CSharp

Serialization and deserialization of .NET objects made easy using various serializer classes that it provides. But serialization of Dictionary object is not that much easy. For this, you have to create a special Dictionary class which is able to serialize itself. The serialization technique might be different in different business cases.

 

Today, let’s discuss how to implement the same with a sample. Code is shared in the post, which you can use in your application. Continue reading and let me know if you have any other approaches.

Published by on under .Net | CodeProject

If you are building add-ins for Microsoft Word, at the time of add-in installation you might want to check whether user has installed MS Word on his system or not. Based on that, you might want to show a message to the user or take proper action as per your business need.

 

In this small blog post, we will learn what needs to be done using C# to find out whether the said Microsoft Office product is installed or not. Continue reading to know about this coding tricks.

Published by on under CSharp | DZone

On various scenarios, especially when you are building and shipping Add-Ins for outlook, at the time of add-in installation you might want to check whether user has installed outlook on his system or not. Based on that, you might want to show a message to the user.

 

In this small blog post, we will learn what needs to be done using C# to find out whether outlook is installed or not. Continue reading to know about this coding tricks.

Published by on under CSharp | DZone

Outlook and other office applications provides an easy way to restart itself. Though there are no directly exposed APIs to restart it, but you can easily write code to do the same operation. Today in this small blog post, we are going to discuss on the code to be implemented.

 

Just three simple steps and your code is ready. C# Code has been shared at the end of the post. Let me know if you have any queries. Would be happy to help.

Published by on under .Net | CSharp

Visual Studio 2015 and .NET 4.6 came up with another new feature (more precisely an enhancement) for C# 6.0 named “Dictionary Initializer”. It’s not a new thing but now you will be able to map the key/indexer directly at the time of dictionary object initialization.

 

Today in this blog post, we will discuss about this with an example. Don’t forget to read the other new features which I posted earlier. Links can be found in this post.

 

Published by on under .Net | C# 6.0

C# 6.0 came with another new feature along with Visual Studio 2015 and .NET 4.6. Now you will be able to write await operations in catch {} and finally {} blocks too. This will help many developers to do certain async operations when they encounter any exceptions or want to do async clean-ups in finally block.

 

Today in this blog post, we will discuss about this new feature. Don’t forget to read the other new features which I posted earlier. Links can be found in this post.

Published by on under .Net | Async

Did you explore the latest of C# 6.0? It brought another new feature called “Expression-bodied function members” which will allow you to write expression bodies for properties, methods etc. instead of writing statement blocks. Thus reducing the code.

 

Today in this post, we will discuss about the new feature “Expression-bodied function members”. Read more to learn about it. Don’t forget to share the feature links in your network.

Published by on under .Net | C# 6.0

C# 6.0 brought another great new feature named “Exception Filters” along with Visual Studio 2015 and .NET 4.6. If you didn’t try yet the preview version of the new IDE, go and grab it to get your hands dirty with the new features before it actually releases.

 

Today in this post, we will discuss about the new feature “Exception Filters”. Read more to learn about it. Don’t forget to share the feature links in your network.

Published by on under .Net | C# 6.0

Team JetBrains released the RTM version of ReSharper 9.0, a very popular productivity tool for the developers using Visual Studio IDE. The new release supports Visual Studio 2015 Preview and C# 6.0, along with many other new features and improvements.

 

In this post, going to share the 30-day trial version link which you can download to try the new bits. Also sharing the link towards the features. Continue to read more.

Published by on under .Net | CSharp