Friday, January 26, 2007

My web SIte

I am building a website for my own in google pages. Not a website still. My friend said i shouldn't not use something made by google for my own web page. What ever i'm continuing. u can take a look here.

Sunday, January 14, 2007

Here is a code which will guide u through this.

The bad thing is the file is not still posted :D


import java.io.File;
import javax.swing.*;
import java.io.*;



public class dir
{
FileWriter fr;
dir()
{
try
{
fr=new FileWriter("c:/outputDir.txt");
}
catch (Exception ex)
{

}


}
public static void main(String args[])
{

dir d=new dir();

d.getDirectoryStructure();
//showFileTree("a");
/*FileDescriptor fd=new FileDescriptor();
String location="a";
File f=new File(location);
String[] s=f.list();

File[] ff=f.listFiles();

for(int j=0;j
{
System.out.println (ff[j].getName());
}
for(int i=0;i
System.out.println (s[i]+"Directory: "+new File(location+"/"+s[i]).isDirectory()+"\n");*/

}

void getDirectoryStructure()
{
String str=JOptionPane.showInputDialog("Enter the directory of which u want to get info");


File f=new File(str);

if(f.exists())
{
showFileTree(str);
}
else
{
try
{
this.fr.write("File does not exist");
//this.fr.close();
}
catch (Exception ex) {
}

}
try
{
this.fr.close();
}
catch (Exception ex) {
}
}


int printTab=0;
int count=0;
void showFileTree(String directory)
{

File f=new File(directory);

File[] allFiles=f.listFiles();

for(int i=0;i
{

for(int j=0;j
{
try
{
fr.write("\t");
}
catch (Exception ex) {
}

System.out.print("\t");
}
try
{
String temp=allFiles[i].getName();
temp=temp.substring(0,temp.indexOf("."));
count++;
fr.write("insert into pinyin values("+count+",'"+temp+"');\n");
}
catch (Exception ex) {
}

//System.out.print("Name: "+allFiles[i].getName()+" +length: "+allFiles[i].length()+ "\n");
if(allFiles[i].isDirectory())
{
printTab++;
showFileTree(allFiles[i].getPath());
}


}
printTab--;
}
}

Saturday, January 6, 2007

Eid is shesh

Eid onek din hoilo shesh. Kurbanir eid beshi ekta valo na. Rozar eid ta