Upload large files to Web API with Javascript

We can upload large files to a REST Web API with JavaScript using FormData. Below JavaScript code snippet uploads the file selected using a standard HTML file input tag. Update the maxAllowedContentLength in web.config as per the requirement. The below snippet shows the maxAllowedContentLength set to accept upto 2GB of data. Below code snippet is…

Detect if Fiddler is Running!

Fiddler is an awesome tool and helps do a lot of things for a developer. And at the same time you might be a little worried about someone running Fiddler to intercept the network activity from your app. If you have used Fiddler yourself, you will know what the risk is. For instance, if the…

Debugging Visual Studio Add-Ins

When a new Visual Studio Add-In project is created, it can be easily debugged just like any other project using F5 Key. But there are a few complications in debugging when a few factors change. I was working on a Visual Studio Add-In. Suddenly I was unable to debug the Add-In project. Then after some investigation I…

Calling Async Method Repeatedly in C#

When an async method needs to be called repeatedly, we need to take care of a few things. If all the data members & processing is within one method with all local variables, we could just use it as any other method. But if there are different private members, global within the class, we need…

Reading Outlook Calendar Work Hours

To the best of my knowledge, there are no Interfaces/properties exposed to retrieve the Outlook Calendar Work Hours (Start Time & End Time). However there is one easy way to retrieve Outlook Calendar Work Hours. We can read those values from registry. These values are stored under the following registry key: HKEY_CURRENT_USERSoftwareMicrosoftOffice{version}OutlookOptionsCalendar You can easily find {version} in the…

Finding Duplicate Files in .NET

Finding if two files are exactly same is very easy in .NET. We use hash functions to check if two files are exactly same. Hash functions are algorithms that compute a hash value or checksum or digest. Hash functions always return distinct computed values for different data/parameters and same computed value every time for same…

Email Verification for Newsletters, Mailing Lists in ASP.NET

It is very important to verify an email id when subscribing for newsletters, mailing lists, etc. If you don’t verify email id, you could end up with many dead email ids. So the process of subscribing for newsletters, mailing lists should include email verification. You can do it as following…. Verify email id using regular…

Custom version of Textbox in .NET

Hi friends, I have created a custom version of Textbox with some cool new properties, events…. Checkout… #Region “D E S I G N E R G E N E R A T E D C O D E” <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class MyTextBox Inherits System.Windows.Forms.TextBox ‘UserControl1 overrides dispose to clean up the component list.…

Microsoft Internship Test Questions

Hi friends… Today I faced Microsoft Internship Test at Microsoft India Development Center (MS IDC), Hyderabad. It was a really amazing experience. I was asked 5 questions in the written test. And I was among the selected 16 students. Written test questions:1] Was given a code to delete a node from a singly linked list.…