public class Test {
   public static void main(String[] args) {
  Properties pp = new Properties();
  try {
pp.load(new FileInputStream("config.properties"));
System.out.println(pp.getProperty("userName"));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
我的config.properties就在src下  为什么找不到