日期:2014-05-17 浏览次数:21161 次
import java.applet.*;
import java.awt.*;
import com.ice.jni.registry.NoSuchKeyException;
import com.ice.jni.registry.RegStringValue;
import com.ice.jni.registry.Registry;
import com.ice.jni.registry.RegistryException;
import com.ice.jni.registry.RegistryKey;
public class IvoGetReg extends Applet {
public void paint(Graphics g) {
////g.drawString("你好,Java世界!", 2, 20);
try {
RegistryKey software = Registry.HKEY_CURRENT_USER
.openSubKey("Software");
RegistryKey ConKey = software.openSubKey("Continuum Data Systems");
RegistryKey IvoSystem = ConKey.openSubKey("IvoSystem");
String subKey1Value = IvoSystem.getStringValue("key0");
g.drawString(subKey1Value, 2, 20);
////String subKey2Value = software.getStringValue("key1");
//g.drawString(subKey1Value + "第二个" + subKey2Value, 2, 20);
IvoSystem.closeKey();
} catch (NoSuchKeyException e) {
e.printStackTrace();
} catch (RegistryException e) {
e.printStackTrace();
}
}
}
<applet code="IvoGetReg.class" archive="registry.jar" name="IvoGetReg"
width=300
height=200>
</applet>
<object
classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
<param name="code" value="Applet1.class">
<comment>
<embed code="Applet1.class"
type="application/x-java-applet;jpi-version=1.5.0">
<noembed>
No Java Support.
</noembed>
</embed>
</comment>
</object>