Config.jsl 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. }
  44. public static int getRelayPort()
  45. {
  46. return 443;
  47. }
  48. public static String getVNCHostName()
  49. {
  50. return "localhost";
  51. }
  52. public static int getVNCPort()
  53. {
  54. return 5900;
  55. }
  56. }