Config.jsl 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package DokeosAppShare;
  2. /**
  3. * Summary description for Config.
  4. */
  5. public class Config
  6. {
  7. public static String getVNCExecutableURL()
  8. {
  9. return "http://dokeos.noctis.be/vnc/winvnc.exe";
  10. }
  11. public static void writeRegOptions()
  12. {
  13. final String KEY_PATH = "SOFTWARE\\ORL";
  14. final String SUB_KEY_PATH = "WinVNC3";
  15. Microsoft.Win32.RegistryKey lm = Microsoft.Win32.Registry.LocalMachine.CreateSubKey(KEY_PATH);
  16. Microsoft.Win32.RegistryKey cu = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(KEY_PATH);
  17. try
  18. {
  19. lm.DeleteSubKeyTree(SUB_KEY_PATH);
  20. cu.DeleteSubKeyTree(SUB_KEY_PATH);
  21. }
  22. catch (Exception e)
  23. {
  24. }
  25. lm = lm.CreateSubKey(SUB_KEY_PATH);
  26. cu = cu.CreateSubKey(SUB_KEY_PATH);
  27. lm.SetValue("AllowLoopback", new Integer(1), Microsoft.Win32.RegistryValueKind.DWord);
  28. lm.SetValue("LoopbackOnly", new Integer(1), Microsoft.Win32.RegistryValueKind.DWord);
  29. //lm.SetValue("DisableTrayIcon", new Integer(1), Microsoft.Win32.RegistryValueKind.DWord);
  30. cu.SetValue("Password", (Object)new ubyte[] { (ubyte)0x8C, (ubyte)0xEA, (ubyte)0x0C, (ubyte)0x33, (ubyte)0x74, (ubyte)0xAC, (ubyte)0x87, (ubyte)0x17 }, Microsoft.Win32.RegistryValueKind.Binary);
  31. cu.SetValue("InputsEnabled", new Integer(0), Microsoft.Win32.RegistryValueKind.DWord);
  32. cu.SetValue("LocalInputsDisabled", new Integer(0), Microsoft.Win32.RegistryValueKind.DWord);
  33. cu.SetValue("FileTransferEnabled", new Integer(0), Microsoft.Win32.RegistryValueKind.DWord);
  34. }
  35. public static int getConnexionCount()
  36. {
  37. return 5;
  38. }
  39. public static String getRelayHostName()
  40. {
  41. //return "dokeos.noctis.be";
  42. //return "localhost";
  43. return "www.dokeos.com";
  44. }
  45. public static int getRelayPort()
  46. {
  47. return 443;
  48. }
  49. public static String getVNCHostName()
  50. {
  51. return "localhost";
  52. }
  53. public static int getVNCPort()
  54. {
  55. return 5900;
  56. }
  57. }