Rss Feed Like Us on facebook Google Plus
Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

May 26, 2014

Can’t Create File In The C Drive Root Directory – Windows

PROBLEM : while developing a java application or any windows application,writes a program to create a file in c drive but getting an error "Access Denied"Try to create an empty file in the C drive root directory manually, but no options to create any files, only new folder is allowed, although The logged in user is under administrator group.

SOLUTION


In Windows 7 or 8 (may be Vista), users (even administrators) are not allowed to create files in the C drive root directory, otherwise, an error message like “A required privilege is not held by the client” or  “access is denied” will be prompted.
To fix it, just turn off the User Account Control (UAC). In Windows 8, do not turn off the UAC via control panel, it must go through the registry.
  1. Press keys “Windows Key + R”, type regedit
  2. Locate HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA
  3. Update the EnableLUA value to 0 (turn if off)
  4. Restart Windows.


Alternatively
1. Go to control panel >> user accounts >> user account control settings >> set to never notify


2. If you think it’s not safe to turn off the UAC feature, then create a new folder under the C drive root directory and put the file inside.
C:\folder\your-file.txt - OK
C:\your-file.txt - NOT OK


 
Read More

August 15, 2013

Auto Refresh an Asp.Net Web page


when You want to Refresh a web page automatically..
You can simply add following line of code in the Header section to enable auto refresh in an ASP.NET web page.
<meta http-equiv="refresh" content="15">
Where 15 refers to the number of seconds it will take before refreshing the page.
Also you can redirect to a specific page if you put the URL inside the tag.

<meta http equiv="refreshcontent="15;url=http://www.techimpulsion.in" >
In reality, this is standard HTML functionality and nothing specific to ASP.NET. The same effect of auto-refresh would be seen whether it is an ASP.NET page or just a HTML page, or a page made in Java, PHP, ColdFusion, Perl or the like.
More Preferential for Asp.net Developers

If you want to set the refresh time dynamically then that can be done in ASP.NET by adding server side code in the Page_Load function to set it, as shown below: 
Response.AppendHeader("Refresh", "15")
you can change the refresh time according to your requirement.
Read More

August 7, 2013

Disable Right Click Button - Javascript

while developing web application ,some situation arises where we have to disable right click button of a mouse in web pages of Asp.Net,PHP ,JSP. you can achieve this by using Javascript.

Qusetion - How to disable right click button of mouse in webpage.

Solution- 
add below script in head section of web page

<script type="text/javascript">
        var msg = "This function is disabled!";
        var bV = parseInt(navigator.appVersion)
        var bNS = navigator.appName == "Netscape"
        var bIE = navigator.appName == "Microsoft Internet Explorer"
 
        function nrc(e) {
            if (bNS && e.which > 1) {
                alert(msg)
                return false
            } else if (bIE && (event.button > 1)) {
                alert(msg)
                return false;
            }
        }
 
        document.onmousedown = nrc;
        if (document.layers) window.captureEvents(Event.MOUSEDOWN);
        if (bNS && bV < 5) window.onmousedown = nrc;
    </script>
..........................................................................................

Read Also...

How to prevent page going back on backspace button click

Read More

© 2011-2016 Techimpulsion All Rights Reserved.


The content is copyrighted to Tech Impulsion and may not be reproduced on other websites.