Banner Ad

Tuesday, September 24, 2013

Create Virtual Directory in IIS

By Francis   Posted at   7:19 PM   IIS Tips and Tricks No comments
                  In previous posts I have explained how to create a virtual directory from Visual Studio.
In this post I’m going to tell how to create a virtual directory in IIS.
What is Virtual Directory?:
Virtual directory meant that, it is a mapping between the actual web application files and IIS. That is we map the website files to the IIS in Virtual Directory. If you see in IIS, it look like a directory but it actually points the exact web application path.
Create Virtual Directory:
Here I’m going to create a virtual directory in IIS for the web application which is located in the path :
“G:\DotNetExamples\AllInOne”.
Step 1:
Open IIS. To open IIS, press windows key + R key, which opens “Run” window and type “inetmgr” and press enter, which opens the IIS.
IIS-Create_Virtual_Directory-1
Step 2:
In IIS, Right click on the “Default Web Site” and select the “Add Application” in the float menu.
IIS-Create_Virtual_Directory-2
Step 3:
In this “Add Application” window, we need to specify the “Virtual Directory” name and the physical directory where the actual web site files are located. Leave the application pool as is. Click OK.
IIS-Create_Virtual_Directory-3
Step 4:
Now the Virtual Directory has been created under the “Default Web Site”. To test the application Right click the virtual directory and choose “Manage Application à Browse” which will open the application in the respective default browser.
IIS-Create_Virtual_Directory-4
IIS-Create_Virtual_Directory-5
Hope this helps!



















Thursday, September 12, 2013

Code Obfuscation

By Francis   Posted at   1:47 PM   Dot Net Obfuscator No comments

          In this post I’m going to discuss about Reverse engineering and Code Obfuscation. In modern programming trends, when we publish a website or dll file to a client machine, there are lot of chance to theft our code. That is if we publish a class library as a dll, there are lot of tools available for simply reverse engineer that dll. So that the person can see the source of such files, which is a potential thread for software companies who does not want to share the source code to the end user.

Below are the some tools which is used to decompile the dll:

Dot net reflector – From Redgate
Dot net decompiler (Dot Peek) – From Jetbrains
Just Decompile – Free tool From Telerik 

What is Obfuscation?
                   Obfuscation is a process to convert the (source code or machine) code into a difficult form which cannot easily read by humans.
Eventhough, obfuscation does not guaranteed 100 % of code safety. However it will make the process too hard, that is getting the source from the dll or exe. In my professional life, I have experienced with DeepseaObfuscator tool.

Here are the list of Obfuscation Tool for .Net:


Hope this helps!

Wednesday, September 11, 2013

Team Foundation Server : Part 2

By Francis   Posted at   11:57 AM   Team Foundation Server 2012 No comments

                     In previous post I have give some points about TFS. Today in my organization I have attended a meeting regarding  Team Foundation Server. I have already told that TFS is awesome product from Microsoft. That is 100% true. I think TFS going to be a huge successful one in future like Visual studio.
In this post I would like to add some new features of TFS 2012 which I learned from the above conference: 
  1. IntelliTrace
  2. Code clone detection
  3. Feedback Manager
  4. Version Controlling
  5. Storyboard creation
  6. Automatic Build update
  7. Shelving 

In the forth coming posts I will explain the above in detail.

Happy programming!



Tuesday, September 10, 2013

Team Foundation Server 2012 – An Introduction

By Francis   Posted at   1:19 PM   Team Foundation Server 2012 No comments
TFS – An Introduction:
                          In my organization, we have recently started using Team Foundation Server 2012. Previously we have worked on the Visual Source Safe for version controlling. Adopting with this new technology is hard at first. After using day by day, it’s awesome. Now I felt that TFS is really awesome product from Microsoft.


TFS not just give an option for version control. Its gives more apart from version controlling like branching etc.  The below are the few important advantages of TFS. If I, missed or added wrongly feel free to contact me or leave a comment.
  • With branching we can easily merge the changes between the projects.
  • We can control the entire project activity with TFS.
  • We can define the source code standards (here called policies) and check against the source code we wrote in Visual studio. That is if any of the code violates the coding standards, we can easily figure it out with this feature.
  • We can assign task to entire team and fill the completed and completion dates.
  • The above are the some  advantages of TFS. In the feature articles I will give the detail explanation of TFS. Keep in touch!
Hope this helps to understand the basic of TFS.

Wednesday, August 28, 2013

ASP.Net: Format Number into 2 digits Using Java script


               In this post we are going to see that how to formatting the number entered in the server side text box.


<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="Blogging.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        // This function is called when the focus moved from Text Box
        function formatNumber() {
            // Get the Controls value
            var strAmount = document.getElementById("<%=txtAmount.ClientID%>").value;
            // Replace the prefix and suffix spaces
            var dblAmount = strAmount.replace(/^s+|s+$/g, '');
            //check the input is not a empty string
            if (dblAmount != '') {
                // check the input is a valid number
                if (isNaN(dblAmount)) {
                    // Alert the User
                    alert("Please enter only whole number");
                    // Clear the values
                    document.getElementById("<%=txtAmount.ClientID%>").value = "";
                }
                else {
                    // Append zeros
                    var strAmount = dblAmount + "." + "00";
                    //strAmount = strAmount.replace(/^s+|s+$/g, '');
                    document.getElementById("<%=txtAmount.ClientID%>").value = strAmount;
                }
            }
        }
        // Called when the focus set on the Text Box
        function removeZeros() {
            // Get the Controls value
            var strAmount = document.getElementById("<%=txtAmount.ClientID%>").value;
            // Replace the prefix and suffix spaces
            strAmount = strAmount.replace(/^s+|s+$/g, '');
            // Replace the Zeros and Dot
            var dblAmount = strAmount.replace(".00", "");
            //check the input is a valid number
            if (dblAmount != '') {
                // check the input is a valid number
                if (isNaN(dblAmount)) {
                    alert("Please enter only whole number");
                }
                else {
                    // Assign the value to text box
                    document.getElementById("<%=txtAmount.ClientID%>").value = dblAmount;
                }
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    Enter A Whole Number :
    <asp:TextBox ID="txtAmount" runat="server" onblur="formatNumber();" onfocus="removeZeros();">
    </asp:TextBox>
    </form>
</body>
</html>

Let’s have a look at that line:

<asp:TextBox ID="txtAmount" runat="server" onblur="formatNumber();" onfocus="removeZeros();"></asp:TextBox> 

Which declares ASP.Net text box,  with 2 client side events “onblur” and “onfocus”.

Onfocus – used to call a javascript function when the focus set on that control. That is when you click on the text box this will fired.
Onblur – Used to call a javascript function when the focus is moved to next control. When the user press tab key this event triggered.

         In the javascript functions “formatNumber” and “removeZeros” I have used some regular expression to remove the leading and trailing spaces.
I have previously explained the purpose of ClientID in this post.

To run this program, just copy and paste that code in a webform and hit F5.

Please go thru the comments in the javascript for better understanding.

Provide your valuable comments to improve my articles.


Hope this helps a bit!

Connect with Us