.Net & C#

Render HTML file with C# console application and open it in browser

I created an application which rendered a report in HTML. To improve it, I wanted it to open the rendered file in browser to simplify the viewing one. In the beginning I thought about using the CMD file, but I found a better solution. Read more»

.Net & C#

Render and Save PDF file from HTML in MVC 5 Application

In my application I had rendered JSON data with AngularJS and I had to send it to a controller in my MVC application to render PDF file and to allow a user to save it. So, the task was dynamically to submit the request, render a file and allow user to save it. Read more»

.Net & C#

StreamWriter – how not to clear existing text

StreamWriter has some options of usage. You can as add new text to an existing text in file, so and to clean existing text and add a new one. Read more»

.Net & C#

C# Convert DataTable to List generic collection

C# snippet below helps to read SQL data to List<T> generic collection without any extensions or frameworks only with SQL and LINQ. Read more»

.Net & C#

CRC has failed with DotNetZip (Ionic.Zip) library

Junior developer created some tools which packed to zip-archive some rendered files. He used for this DotNetZip (Ionic.Zip) library. Everything worked fine until today. But today, when users users tried to open zip-file, they’ve got the error “CRC has failed, the file is corrupt”. Read more»

.Net & C#

Get images from tag ‘img src’ from string variable

Here’s a useful snippet in C#. This method gets all the images from variable type String. It can be HTML or XML text with tags <img src=”path_to_image”> Read more»

.Net & C#

Reading and querying XML file in C#

Reading and querying XML data is good with Link to XML in C#. LINQ to XML provides an in-memory XML programming interface that leverages the .NET Language-Integrated Query (LINQ) Framework. Read more»

.Net & C#

Read CSV file to List<T> using CSVHelper

CsvHelper

CsvHelper is a very good library for reading and writing CSV files. It’s really easy for coding and fast for work. You can install it via Nuget in Visual studio or download from the project page in GitHub https://github.com/JoshClose/CsvHelper.  Read more»

.Net & C#

How to get assembly strong name in Visual Studio

Fig.1. Create external tool for Visual Studio to get assembly strong name

When I was developing a web service for SharePoint 2010 I had to fill in “assembly strong name” in .asmx file. Below I repost a very nice method how to get an “assembly strong name” in Visual Studio. Read more»

.Net & C#

Popular Posts