About Me

My photo
India
Hey there, lovely people! I'm Hemant Menaria, and I'm passionate about programming. Having completed my MCA in 2011, I've delved into the world of coding with fervor. I believe in sharing knowledge, making complex concepts easy to grasp for everyone. JAVA, PHP, and ANDROID hold a special place in my heart, and I spend most of my time immersed in them. Currently, I'm deeply engaged in API/Webservice frameworks and crafting Hybrid mobile applications to enhance flexibility in the digital realm. If you ever find yourself stuck with a programming challenge, feel free to reach out to me at +91-8955499900 or drop me a line at hemantmenaria008@gmail.com. I'm always eager to help fellow enthusiasts navigate the intricacies of coding!

Tuesday, January 7, 2014

Connect two computer Using cross cable



1: Make sure both computers are turned off.
2: Plug each end of the crossover cable into a network port on the back of each computer.
3: Turn both computers on (it does not matter which one you turn on first).
4: Sign-in to Windows on both computers, as you normally do.
5: Wait until both computers have fully loaded Windows and all startup programs (your mouse pointer will be the normal arrow shape and the programs that load in the system tray (usually located at the bottom right side of the screen, to the left of the time-clock) will all be there when the system is ready to use for configuration).
6. Select one of the computers to complete the rest of the process.
 7. Open The Network and Sharing Centre. Click "Start," then "Control Panel," then "Network and Internet." Lastly, click "Network and Sharing Centre." 
8. Double click the "Unidentified Network" icon.
If you have more than one network, this icon will be identified as "multiple networks."
9. In Network, click the information bar. Next, click on "Turn on network discovery and file sharing." If you are prompted for a password or confirmation, type it in or provide confirmation.

 Note: Both PC Should be on the same network. (or you can set ip address manually like: 1st PC- 10.68.2.20, 2nd PC- 10.68.2.21. with same Subnet 255.255.255.0

More Watch this Video:


Download a file in jsp


<%@ page import="java.util.*,java.io.*"%>

<%
   
    File f = new File ("filePahtNeedToDownload"); //read  file name.
    /* set  content type ( word,excel,pdf,txt..etc) here we try for a pdf file */
    response.setContentType ("application/pdf");
    //setting  header and the Name by which user will save the file.
    response.setHeader ("Content-Disposition", "attachment; filename=\"DownloadfileName.pdf\"");
   
    //retrive file name
    String name = f.getName().substring(f.getName().lastIndexOf("/") + 1,f.getName().length());
   
   
        InputStream in = new FileInputStream(f);
        ServletOutputStream outs = response.getOutputStream();
       
       
        int bit = 256;
        int i = 0;
        try {
            while ((bit) >= 0) {
                bit = in.read();
                outs.write(bit);
            }
       
        } catch (IOException ioe) {
            ioe.printStackTrace(System.out);
        }
        outs.flush();
        outs.close();
        in.close();   
%>

Remove Shortcut Virus from Pen drive or Memory Card


Open command prompt and type this command.
Note: here "g:" is drive on which you want to perform operation, so at the place of "g" write your drive label.

attrib -h -r -s /s /d g:\*.*