Welcome, Guest. Please login or register.
Did you miss your activation email?
Pages: [1]   Go Down
  Print  
Author Topic: password  (Read 686 times)
0 Members and 1 Guest are viewing this topic.
JavaLearner
Member
*

Reputation: 0
Offline Offline
Posts: 34
Referrals: 0

Awards
« on: July 11, 2009, 08:41:04 AM »

i want to write a code to generat passwords but, a random generator method inside it not changing its value, can i get a solution to this d analternative way to generate password using matric number of the form s60202003
Code
GeSHi (java):
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5.  
  6. package key;
  7.  
  8. /**
  9.  *
  10.  * @author HARLEY
  11.  */
  12. import java.io.*;
  13. import java.util.*;
  14. public class Main {
  15.    public static void main(String[] args) throws IOException {
  16.        File inputFile = new File("cc.txt");
  17.  
  18.        File outputFile = new File("cico.txt");
  19.  
  20.        BufferedReader in = new BufferedReader(new FileReader(inputFile));
  21.  
  22.        BufferedWriter out = new BufferedWriter(new FileWriter(outputFile));
  23.  
  24.        String line;
  25.        int jack = 60 ;
  26.        int adme = 1;
  27.        while ((line = in.readLine())!= null) {
  28.  
  29.            //int num = line.hashCode();
  30.            //int namei = Integer.parseInt(line.substring(7));
  31.            Random rand = new Random(100);
  32.            int numt = rand.nextInt(50);
  33.  
  34.            if (line.length()>3) {
  35.  
  36.  
  37.                adme += 1;
  38.                Formatter formato = new Formatter();
  39.            int sys = Integer.parseInt(line.substring(7));
  40.            sys = 64 +sys;
  41.           // namei = jack + namei;
  42.            //int js = line.substring(6);
  43.           char form = (char) (sys);
  44.           String hnome = (formato.format("%c",sys).toString());
  45.           String nam = hnome.toLowerCase();
  46.  
  47.            //String suname = name.substring(2);
  48.            //char col = line.charAt(3);
  49.            //int num = line.hashCode();
  50.            //int nnum = Math.abs(num);
  51.            /**
  52.             Formatter formato = new Formatter();
  53.             String hnome = (formato.format("%d",jack).toString());
  54.             String hname = hnome.substring(0,2);
  55.             String hname2 = hnome.substring(3,5);
  56.             int nonam = line.length();
  57.             String namea = line.substring(0,1);
  58.             out.write(hname+hnome);
  59.             */
  60.           System.out.println(nam+adme+numt);
  61.          out.write("");
  62.          out.newLine();
  63.            }
  64.               }
  65.        in.close();
  66.        out.close();
  67.    }
  68. }
Created by GeSHI 1.0.7.20
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Your Ad Here