Posts

Showing posts from February, 2019

Web scraping through WebBrowser (.Net WinForm Control)

Image
In this post, I am going to explain how it is easy to extract and change the the web-page content through Web-Browser control. The Web-Browser is a Microsoft windows form control and easy to use. This post will explain you how you can use this control for your need. The Web-Browser control is used to display the web-page in your application. The Web-Browser class is a powerful class that give you leverage to manipulate the html code, interact with JavaScript, automate the web scrapping and many more. You can find more about the Web-Browser from MSDN library. The following steps will guide you how to use the Web-Browser. 1.         The first thing that you should do is to create a windows application project. 2.         Add a Web-Browser and two button controls on web form.   3.         Set the “Url” property of the control or you can do this by writing...

Secure your website to be iframed

In this post I am going to explain how you can secure you website from being iFramed. When you are presenting sensitive data on website then you must secure your data from other websites. In order to do this, you need to add a below header on the web server. Header Name – X-Frame options header Options                 Deny – Block all the sites                 Sameorigin – Allow only the sites have same origin.                 Allow-From - Specify list of domain name

List of RSA Key Container names

List RSA key container If you are struggling to get which RSA key installed on your machine then this post will help you in this. There is no straight forward thing that will give you the installed RSA containers names. With the help of below steps you will be able to get the list of installed RSA key container names. So, without wasting any time more let’s jump on the solution. Step 1. Open visual studio IDE and create a console application Step 2. Add “ using  System.IO; ” namespace to the program class Step 3. Add below code in Main method var  files = System.IO. Directory .GetFiles( @"C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys\" );              foreach  ( var  f  in  files)             {                  // try catch is ...

Microsoft Fakes Framework - Shim

Image
I was writing the unit test cases using the Microsoft Fakes framework so thought to share my knowledge with you all. I majorly used Shim to write my test cases, so this post mostly focuses on Shim. I will write another post on Stub in coming days. As most of you know that this is not the only one framework in market to write fake unit test cases the advantage of using this framework on the other is that you have full control on the test case. It will allow you to test your test case if some part of the application is not ready. Why to use Shim? The basic question will come in your mind that why to use Shim not the Stub. For me both are same and depend on the design of your application. If you are using any design pattern in your application except singleton then it will be advisable to use the Stub because it work very well with “Interfaces” and it is clearly mentioned in the Microsoft site as well. Shim basically reduces the burden from the compiler by not maki...