Tuesday, May 16, 2017

How to change web.config without loosing session

In application  by default we have InProc session state and due to this our session is stored in application memory that's why when we change web.config, it lost session also.

sessionState mode="InProc" timeout="30"

To overcome this  problem use "StateServer" session state. It stores application session in server memory where our application is hosted.

sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" timeout="30"

Thanks
Anil



Monday, February 1, 2016

Steps of Keyboard to appear key on screen

step 1: Keyboard->[sends an electrical signal]->

step 2: Computer(keyboard controller)->[interprets the signal and forward scan code to]->

step 3: Processor->[routes it to the program for]->

step 4: Operating system->[sends a message to that current active window]->

step 5: Current window->[process the signal by taking one byte of computer memory (RAM) and sends to]->

step 6: Operating system->[will add it to video card]

step 7: Next time when the video card refreshes your monitor the letter will appear on the screen

Monday, September 14, 2015

The Five Dysfunctions of a Team

Dysfunction #1: Absence of Trust
The fear of being vulnerable with team members prevents the building of trust within the team.

Dysfunction #2: Fear of Conflict
The desire to preserve artificial harmony stifles the occurrence of productive ideological conflict.

Dysfunction #3: Lack of Commitment
The lack of clarity or buy-in prevents team members from making decisions they will stick to.

Dysfunction #4: Avoidance of Accountability
The need to avoid interpersonal discomfort prevents team members from holding one another accountable.

Dysfunction #5: Inattention to Results

The pursuit of individual goals and personal status erodes the focus on collective success.

Follow the below URL
http://flpbs.fmhi.usf.edu/pdfs/Five%20Dysfunctions%20of%20a%20Team.pdf

Please share your feedback or comments.

Thanks
Anil

Thursday, July 30, 2015

Encryption of web.config file

There are two ways to encrypt your web.config sections.

1. Using VS.NET utility "aspnet_regiis"
 
    Ex.

    C:\Windows\Microsoft.NET\Framework\v2.0.50727 aspnet_regiis -pef "appSettings" "D:\project\PP_Publish" -prov RSAProtectedConfigurationProvider

   Follow the URL for more info.

   http://blogs.msdn.com/b/mosharaf/archive/2005/11/17/protectedconfiguration.aspx
 
  http://www.codeproject.com/Articles/877258/How-to-Encrypt-Web-config-Using-aspnet-regiis-exe

2. Programmatically encrypt your web.config file

   ///////////////////////// To Encrypt /////////////////////////
Configuration config;
ConfigurationSection configSection;
config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
configSection = config.GetSection("connectionStrings");
if (configSection != null)
{
if (!(configSection.SectionInformation.IsLocked))
{
configSection.SectionInformation.ProtectSection("DataProtectionConfigurationProvider");
config.Save();
}
}



///////////////////////// To Decrypt /////////////////////////

Configuration configD;
ConfigurationSection configSectionD;
configD = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
configSectionD = configD.GetSection("connectionStrings");
if (configSectionD != null)
{
if (!(configSectionD.SectionInformation.IsLocked))
{
configSectionD.SectionInformation.UnprotectSection();
configD.Save();
}
}

For more info, follow the below URL

http://www.techrepublic.com/blog/software-engineer/encrypting-net-configuration-files-through-code/

Thanks
Anil
  

Tuesday, June 30, 2015

How the year, time and clock is measured?

Our perception of time is based on the earth's revolution around the sun and its rotation around its own axis. One complete cycle around the sun is a year, while a complete rotation on its axis constitutes a day. 
Based on these observations, a day has 24 hours while 365 days constitute a year. The day is further divided into hours, minutes and seconds.
 Time measured by the earth's rotation relative to the sun is called solar time. For any given point, there could be two values of solar time — apparent and mean. Apparent time is measured by direct observation of the sun by a sundial. Mean solar time, however, is measured by assuming that relative to the earth, the sun is at the same position after every 24 hours. Most clocks and watches are based on mean solar time. 

What is the most accurate measure of time?
Measurement of time based on the earth's rotation and revolution has its limitations and hence the unit of time defined by the International System of Units is not based on astronomical observation. 
The length of a second is defined according to the vibrations of caesium atoms at various atomic clocks. International Atomic Time is based on a system of about 270 atomic clocks. Signals from these clocks are transmitted to the International Bureau of Weights and Measures located in Sevres, France, which uses the signals to form the International Atomic Time. Seconds measured by atomic clocks are the most accurate. These clocks are predicted to be off by less than a second in 50 million years. 

Monday, April 27, 2015

URL Routing to remove .aspx extension from URL in C#.net

Global.asax File:

static void RegisterRoutes()
{
System.Web.Routing.RouteTable.Routes.Add("login",new System.Web.Routing.Route("login", new RouteHandler("~/login.aspx")));
System.Web.Routing.RouteTable.Routes.Add("Main", new System.Web.Routing.Route("Main", new RouteHandler("~/Main.aspx")));
System.Web.Routing.RouteTable.Routes.Add("Message", new System.Web.Routing.Route("Message", new RouteHandler("~/Message.aspx")));
}

public class RouteHandler : IRouteHandler
{
string _virtualPath;
public RouteHandler(string virtualPath)
{
_virtualPath = virtualPath;
}
public IHttpHandler GetHttpHandler(RequestContext requestContext)
{
foreach (var value in requestContext.RouteData.Values)
{
requestContext.HttpContext.Items[value.Key] = value.Value;
}
return (Page)System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(_virtualPath, typeof(Page));
}
}

Web.config:










        
 
 
 
       




 
 
   




Sunday, May 4, 2014

Deploy ASP.NET application on Linux for iPad/Android


There are two option to enable .NET developers to extend their application deployment to Linux environments.


  1. MainSoft: Refer http://dev.mainsoft.com/
  2. Mono Project: Refer http://www.mono-project.com/Main_Page


In MainSoft there is a  product, called Grasshopper allows ASP.NET, ASMX Web Services, and other server based applications to be compiled to Java bytecode and executed in a J2EE server running on Linux.

GrassHopper is a Visual Studio-based SDK and patented .NET to Java converter that enables you to run .NET Web and server applications to run on Linux® and other Java-enabled platforms.

For More Information Refer below link


Pl do comment if you want to know more.

Thanks