Category Archives: C#.NET

How to download multiple files parallel in C#.NET Console

How to download multiple files parallel in ASP.NET MVc This article will show you how to download multiple files in ASP.NET MVC, We are using Parallel.ForEach loop to download multiple file. Parallel.ForEach executes each element parallel and wait till they … Continue reading

Posted in C#.NET, MVC | Tagged , | Leave a comment

INTERVIEW QUESTION

INTERVIEW QUESTION Name a few different return types of a controller action method? The following are just a few return types of a controller action method. In general an action method can return an instance of a any class that … Continue reading

Posted in C#.NET, MVC | Tagged , | Leave a comment

How to extract 7z file to a folder C# .net

This article will show you how to extract .7z, .zip, .rar file using 7z.exe in C#.net. Here we add the code to control the 7-Zip executable. In the first part of the code, we specify the source file name and … Continue reading

Posted in C#.NET, MVC | Tagged , | Leave a comment

Multiple file-extensions searchPattern for System.IO.Directory.GetFiles

This article will show you to get multiple file-extension search pattern, in regular way you can get files with specific extensions but using same how to get Multiple file-extension, basically we are querying on the list file and get only … Continue reading

Posted in C#.NET, MVC | Tagged | 1 Comment

How to get the client IP address for the current controller call.

This article will show you hoe to get client IP address for the current controller Note: you have to add using System.ServiceModel.Channels; namespace. Add a reference to the assembly System.ServiceModel. Select Project-> Add Reference and then select the assembly name … Continue reading

Posted in C#.NET, MVC | Tagged , | Leave a comment

How to access session in web api controller in mvc4

I realize session and REST don’t exactly go hand in hand but it is not possible to access session state using the new Web API. HttpContext.Current.Session is always null. REST is stateless. If you use a session the processing will … Continue reading

Posted in C#.NET, MVC | Tagged , | 1 Comment

How to set read write permission to directory in C#.NET

While working with files and directory we need read write permission on files and folders, this can be done by manually giving access permission to directory as well as programmatically. Here is code Full access control to folder or directory … Continue reading

Posted in C#.NET | Tagged | Leave a comment