Reputation: 17233
Is there a way to read the windows registry from a web based application with no user interaction? I'm open to any technology suggestion.
Upvotes: 0
Views: 3881
Reputation: 21
This can be done in java:
public class RegistryRead {
public static void main(String[] args) {
RegistryRead demo = new RegistryRead();
demo.doit();
// IO.PressAnyKey();
}
public void doit() {
displayUserName();
displayODBCDSN();
}
public void displayUserName(){
com.ms.wfc.app.RegistryKey regKey;
String userName;
regKey =
com.ms.wfc.app.Registry.LOCAL_MACHINE.getSubKey
("Network\\Logon");
if (regKey == null) {
userName = "Unable to get username from Registry!";
}
else {
userName = (String) regKey.getValue("username");
}
System.out.println("Username : " + userName);
}
public void displayODBCDSN() {
com.ms.wfc.app.RegistryKey regKey;
regKey =
com.ms.wfc.app.Registry.CURRENT_USER.getSubKey
("Software\\ODBC\\ODBC.INI\\ODBC Data Sources");
if (regKey == null) {
System.out.println("Unable to get ODBC DSN Registry!");
}
else {
String dsn [] = regKey.getValueNames();
System.out.println("ODBC DSN defined : ");
for(int i = 0; i < dsn.length; i++) {
System.out.println(dsn[i]);
}
}
}
}
Upvotes: 2
Reputation: 14959
I'm afraid that the short response, as already stated, to your question is NO, you can't access the registry from client.
Maybe you can resort to an activex (bounding your application to Microsoft browsers)
Maybe, if your goal is just to implement some sort of user/license verification (I interpret in this way your response to my comment), you may find useful the webstorage / client side storage alternatives.
As I know there are different implementation, technologies, you can leverage on.
A starting point for your investigations can be
http://wonko.com/post/search-pad-browser-storage
Upvotes: 0
Reputation: 37104
Nope. Web techs such as silverlight are designed to run sandboxed by default. There are certain actions that are allowed/enabled by silverlight that break that convention but they all require explicit confirmation by the user.
Upvotes: 1
Reputation: 313
.NET offers ways of doing this, http://msdn.microsoft.com/en-us/library/85t3c3hf.aspx
Upvotes: -2