不要加 ":"写成     证券代码=证券代码让后java.util.Properties prop=new java.util.Properties();
prop.load(new FileInputStream(new File("f10.properties")));
System.out.println(prop.getProperty("证券代码"));
//试试

解决方案 »

  1.   

    Properties 是一个Hashtable,如果你要得到的是 “证券代码:”这个字符串,那应该先
    setProperty(String key,"证券代码:");
    这样在你getProperty(key)的时候才能得到  “证券代码:”! 
      

  2.   

    建一个MYProperties .properties 文件,在你的web-inf/classes/下
    里面写
    证券代码=证券代码        String s = null;
            try
            {
                ResourceBundle resourcebundle = ResourceBundle.getBundle("MYProperties");
                s = resourcebundle.getString(“证券代码”);
            }
            catch(Exception exception)
            {
                exception.printStackTrace();
            }
    OK!