Skip to main content

Posts

machine key generator

This tool allows you to generate random keys for validation and ecnryption/decryption of the view state (and other purposes). It builds a element which you need to include in your web.config file. The tool creates a 256-bit decryption key and a 512-bit validation key, with Rijndael as the data validation algorithm. http://aspnetresources.com/tools/machineKey

start or stop a service using batch file

To start a service and copy the files and stop the service in windows service . Please check the below code @echo off net stop " service name" echo service stopped XCOPY c:\books.xml D:\books.xml echo copied net start " service name" :end The  command net start " service name" will start the service, change the service name to your desirable  service to start The  command net stop " service name" will stop the service, change the service name to your desirable  service to stop XCOPY command will copy the file from source to target destination type all these command under a batch file and save it and then run it in command prompt It is assumed that the user's know, IIS, windows service

delete service in windows server 2008/server 2003/xp/ vista

How to delete a service in windows server 2008/server 2003/xp/ vista. Note: There are some services which are system specific and cannot be stopped, Be careful while deleting a service The command to delete the service is "sc delete " The above command executes in DOS prompt.  An error will will come when you execute this command: "[SC] OpenService FAILED 5:" To remove this error and to execute the command in good manner.  When you open the command prompt , run it as administrator and then type : "sc delete " This is how to delete the service Start/Stop the service  You  can also start the service by Control panel-->administrative tools--> Services Right Click on the selected service and start/stop it Ps Note: Before deleting a service in windows server 2008/server 2003/xp/ vista you should confirm the name of service and research in google the effect after you  delete a service. It is difficult to recall the service back...

Exception Cross-thread

Exception:- Cross-thread operation not valid: Control 'treeView' accessed from a thread other than the thread it was created on. I have kept treeview, You can replace it with control of your choice Solution   if (treeView.InvokeRequired)                     {                         this.Invoke((MethodInvoker)delegate()                         {                                                     ...

XSS- (cross site scripting)

To protect yourself from XSS cross site scripting . There are may techniques you can get from the Google search engine. There is an  another way in which you can block the "<"  in the user input so that no one can run the script. You can also filter add a filter or a escape character for the same"<" This will block the