elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Entrar al Canal Oficial Telegram de elhacker.net


  Mostrar Temas
Páginas: 1 ... 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 [86] 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ... 105
851  Programación / Scripting / [RUBY] [APPORTE PARA WINDOWS] PATHS v0.3 - Una utilidad para el PATH en: 13 Noviembre 2012, 23:44 pm
    

  PATHS v0.3
   By Elektro H@cker  













   Opciones:

   /? (or) -help  | Muestra la ayuda.

   -l (or) -list  | Lista las entradas del PATH.

   -c (or) -clean | Limpia entradas inválidas o duplicados en los PATH.

   -r (or) -reset | Resetea el PATH al PATH de Windows por defecto.

   -a (or) -add   | Añade una entrada.

   -d (or) -del   | Elimina una entrada.

   -add -current  | Fuerza el añadido de una entrada al "Current_User" PATH.

   -add -local    | Fuerza el añadido de una entrada al "Local_Machine" PATH.



   Ejemplos:

   PATHS -l
  
  • Lista (Indexa) las entradas dle path.

   PATHS -a "C:\Folder"
  
  • Añade la entrada "C:\Folder" al LOCAL_MACHINE PATH.

   PATHS -a current "C:\Folder"
  
  • Añade la entrada "C:\Folder" al CURRENT_USER PATH..

   PATHS -d "3"
  
  • Elimina la entrada nº3 de la lista.

   PATHS -d "C:\Folder"
  
  • Elimina la entrada "C:\Folder".


Compilado: http://elektrostudios.tk/PATHS.exe

PATHS.rb

(El código está algo sucio, pero lo que importa es que funciona xD)

Código
  1. require 'win32/registry'
  2. require 'rainbow'
  3.  
  4.  
  5. # PATHS v0.3
  6. #
  7. # By Elektro H@cker
  8.  
  9.  
  10. # Description:
  11. # -----------
  12. # This is a tool to manage the windows PATH enviroment.
  13. # Add, delete, backup, clean, list, and reset the PATH.
  14.  
  15.  
  16. exit if Object.const_defined?(:Ocra)
  17.  
  18.  
  19. def logo()
  20.  print "
  21.   PATHS v0.3
  22.  
  23.   By Elektro H@cker
  24.  
  25. ".foreground(:white)
  26. end
  27.  
  28.  
  29. def help()
  30.  print '
  31.  
  32.   Options:
  33.  
  34.   /? (or) -help   | Show this info.
  35.  
  36.   -l (or) -list   | List the entries.
  37.  
  38.   -b (or) -backup | Backup the entries.  
  39.  
  40.   -c (or) -clean  | Clean duplicates and invalid directories in the paths.
  41.  
  42.   -r (or) -reset  | Reset the paths to the Windows defaults.
  43.  
  44.   -a (or) -add    | Add a entry.
  45.  
  46.   -d (or) -del    | Delete a entry.
  47.  
  48.   -add -current   | Force adding a entry into the current user path.
  49.  
  50.   -add -local     | Force adding a entry into the local machine path.
  51.  
  52.  
  53.  
  54.   Examples:
  55.  
  56.   PATHS -l
  57.   [+] Indexes all the entries.
  58.  
  59.   PATHS -a "C:\Folder"
  60.   [+] Adds a entry into the local path.
  61.  
  62.   PATHS -a current "C:\Folder"
  63.   [+] Adds a entry into the current user path.
  64.  
  65.   PATHS -d "3"
  66.   [+] Deletes the 3rd entry of the indexed list.
  67.  
  68.   PATHS -d "C:\Folder"
  69.   [+] Deletes a entry.
  70.  
  71.  '
  72.  exit
  73. end
  74.  
  75.  
  76. def error(kind)
  77.  print "[+] ERROR"
  78.  if kind == "pos"      then print "\n    Index #{ARGV[1]} is out of range, only #{$pos} entries.\n" end
  79.  if kind == "notfound" then print "\n    Directory \"#{ARGV[1]}\" not found in PATH.\n" end
  80.  exit
  81. end
  82.  
  83.  
  84. def args()
  85.  if ARGV.empty?                                   then get_paths("visible") end
  86.  if ARGV[0] == "/?"    or ARGV[0] =~ /^-help$/i   then help()               end  
  87.  if ARGV[0] =~ /^-l$/i or ARGV[0] =~ /^-list$/i   then get_paths("visible") end
  88.  if ARGV[0] =~ /^-b$/i or ARGV[0] =~ /^-backup$/i then backup_path()        end
  89.  if ARGV[0] =~ /^-c$/i or ARGV[0] =~ /^-clean$/i  then clean_path()         end    
  90.  if ARGV[0] =~ /^-d$/i or ARGV[0] =~ /^-del$/i    then del_path()           end
  91.  if ARGV[0] =~ /^-a$/i or ARGV[0] =~ /^-add$/i    then add_path()           end
  92.  if ARGV[0] =~ /^-r$/i or ARGV[0] =~ /^-reset$/i  then reset_path()         end
  93. end
  94.  
  95.  
  96. def get_paths(visibility)
  97.  
  98.  $pos = 0
  99.  
  100.  # HKCU path
  101.  if not visibility == "hidden" then puts "\n   [+] Current User PATH:\n\n" end
  102.  Win32::Registry::HKEY_CURRENT_USER.open('Environment') do |reg|
  103.    for dir in reg['Path'].split(";").sort do
  104.  $pos = $pos+1
  105.  dir = dir.gsub(/^PATH=/, "")
  106.      instance_variable_set "@_#{$pos}", dir + "?CURRENT_USER"
  107.      if not File.directory? dir then invalid = "(Directory doesn't exist)".foreground(:red).bright else invalid ="" end
  108.      if not visibility == "hidden"
  109.        if $pos < 10 then puts "    #{$pos.to_s} = #{dir} #{invalid}" else puts "    #{$pos.to_s}= #{dir} #{invalid}"end
  110.      end
  111.    end
  112.  end
  113.  
  114.  # HKLM path
  115.  if not visibility == "hidden" then puts "\n\n   [+] Local Machine PATH:\n\n" end
  116.  Win32::Registry::HKEY_LOCAL_MACHINE.open('SYSTEM\CurrentControlSet\Control\Session Manager\Environment') do |reg|
  117.    for dir in reg['Path'].split(";").sort do
  118.  $pos = $pos+1
  119.  dir = dir.gsub(/^PATH=/, "")
  120.      instance_variable_set "@_#{$pos}", dir + "?LOCAL_MACHINE"
  121.      if not File.directory? dir then invalid = "(Directory doesn't exist)".foreground(:red).bright else invalid ="" end
  122.      if not visibility == "hidden"
  123.        if $pos < 10 then puts "    #{$pos.to_s} = #{dir} #{invalid}" else puts "    #{$pos.to_s}= #{dir} #{invalid}"end
  124.      end
  125.    end
  126.  end
  127.  if not visibility == "hidden" then exit end
  128.  $max_pos = $pos
  129.  
  130. end
  131.  
  132.  
  133. def add_path()
  134.  
  135.  if ARGV[1] =~ /^-current$/ then key = "current" else key = "local" end
  136.  
  137.  # HKCU path
  138.  if key == "current"
  139.    Win32::Registry::HKEY_CURRENT_USER.open('Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  140.      value = reg['Path']
  141.      reg.write('Path', Win32::Registry::REG_SZ, "#{value};#{ARGV.last}")
  142.      puts "[+] Entry added in User PATH: #{ARGV.last}"
  143.    end
  144.  end
  145.  
  146.  # HKLM path
  147.  if key == "local"
  148.    Win32::Registry::HKEY_LOCAL_MACHINE.open('SYSTEM\CurrentControlSet\Control\Session Manager\Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  149.      value = reg['Path']
  150.      reg.write('Path', Win32::Registry::REG_SZ, "#{value};#{ARGV.last}")
  151.      puts "[+] Entry added in Local PATH: #{ARGV.last}"
  152.    end
  153.  end
  154.  
  155. end
  156.  
  157.  
  158. def del_path()
  159.  
  160.    get_paths("hidden")
  161.    final_path = ""
  162.    found      = 0
  163.    notfound   = 0
  164.  
  165.  if ARGV[1] =~ /^[1-9]+$/
  166.  
  167.    choose     = instance_variable_get "@_#{ARGV[1]}"
  168.  
  169.    if ARGV[1].to_i > $max_pos.to_i then error("pos") end
  170.  
  171.    # HKCU PATH index deletion
  172.    if choose["?CURRENT_USER"]
  173.      Win32::Registry::HKEY_CURRENT_USER.open('Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  174.        value = reg['Path']
  175.        for dir in reg['Path'].split(";").sort do
  176.          if not dir == choose.split("?").first then final_path << ";" + dir end
  177.        end
  178.        reg.write('Path', Win32::Registry::REG_SZ, final_path[1..-1])
  179.      end
  180.      puts "[+] Entry deleted in User PATH: #{choose.split("?").first}"
  181.    end
  182.  
  183.    # HKLM PATH index deletion
  184.    if choose["?LOCAL_MACHINE"]
  185.      Win32::Registry::HKEY_LOCAL_MACHINE.open('SYSTEM\CurrentControlSet\Control\Session Manager\Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  186.        value = reg['Path']
  187.        for dir in reg['Path'].split(";").sort do
  188.          if not dir == choose.split("?").first then final_path << ";" + dir end
  189.        end
  190.        reg.write('Path', Win32::Registry::REG_SZ, final_path[1..-1])
  191.      end
  192.      puts "[+] Entry deleted in Local PATH: #{choose.split("?").first}"
  193.    end
  194.  
  195.  elsif
  196.  
  197.    # HKCU PATH str deletion
  198.      Win32::Registry::HKEY_CURRENT_USER.open('Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  199.        value = reg['Path']
  200.        for dir in reg['Path'].split(";").sort do
  201.          if not dir =~ /^#{Regexp.escape(ARGV[1])}$/i then final_path << ";" + dir else found = "yes" end
  202.        end
  203.        reg.write('Path', Win32::Registry::REG_SZ, final_path[1..-1])
  204.        if found == "yes" then puts "[+] Entry deleted in User PATH: #{ARGV[1]}" else notfound = 1 end
  205.      end
  206.  
  207.    # HKLM PATH str deletion
  208.      final_path = ""
  209.      found = ""
  210.      Win32::Registry::HKEY_LOCAL_MACHINE.open('SYSTEM\CurrentControlSet\Control\Session Manager\Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  211.        value = reg['Path']
  212.        for dir in reg['Path'].split(";").sort do
  213.          if not dir =~ /^#{Regexp.escape(ARGV[1])}$/i then final_path << ";" + dir else found = "yes" end
  214.        end
  215.        reg.write('Path', Win32::Registry::REG_SZ, final_path[1..-1])
  216.        if found == "yes" then puts "[+] Entry deleted in Local PATH: #{ARGV[1]}" else notfound = notfound+1 end
  217.        if notfound == 2 then error("notfound") end
  218.      end
  219.  
  220.    end
  221.  
  222. end
  223.  
  224.  
  225. def backup_path()
  226.  
  227.  # if type REG_EXPAND_SZ convert it first to REG_SZ
  228.  # HKCU path
  229.    Win32::Registry::HKEY_CURRENT_USER.open('Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  230.      value = reg['Path']
  231.      reg.write('Path', Win32::Registry::REG_SZ, value)
  232.    end
  233.  # HKLM path
  234.    Win32::Registry::HKEY_LOCAL_MACHINE.open('SYSTEM\CurrentControlSet\Control\Session Manager\Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  235.      value = reg['Path']
  236.      reg.write('Path', Win32::Registry::REG_SZ, value)
  237.    end
  238.  # Conversion end
  239.  
  240.  system('Regedit.exe /E "%TEMP%\HKCU PATH.reg" "HKEY_CURRENT_USER\Environment"')
  241.  system('Regedit.exe /E "%TEMP%\HKLM PATH.reg"  "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"')
  242.  system('type "%TEMP%\HKCU PATH.reg" | Findstr /I "\"PATH\" HKEY_CURRENT_USER Registry" > "%USERPROFILE%\Desktop\HKCU PATH %DATE:/=-%.reg"')
  243.  system('type "%TEMP%\HKLM PATH.reg" | Findstr /I "\"PATH\" HKEY_LOCAL_MACHINE Registry" > "%USERPROFILE%\Desktop\HKLM PATH %DATE:/=-%.reg"')
  244.  puts "[+] A copy of your current PATH saved at your desktop."
  245.  exit
  246. end
  247.  
  248.  
  249. def reset_path()
  250.  Win32::Registry::HKEY_CURRENT_USER.open('Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg| reg.write('Path', Win32::Registry::REG_SZ, 'C:\Windows;C:\Windows\system32;C:\Windows\System32\Wbem;C:\Windows\syswow64;C:\Windows\System32\WindowsPowerShell\v1.0') end
  251.  Win32::Registry::HKEY_LOCAL_MACHINE.open('SYSTEM\CurrentControlSet\Control\Session Manager\Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg| reg.write('Path', Win32::Registry::REG_SZ, 'C:\Windows;C:\Windows\system32;C:\Windows\System32\Wbem;C:\Windows\syswow64;C:\Windows\System32\WindowsPowerShell\v1.0') end
  252.  puts "[+] PATH restored to Windows defaults."
  253. end
  254.  
  255.  
  256. def clean_path()
  257.  
  258.  puts "\n[+] Searching invalid or duplicated entries in the PATH...\n\n"
  259.  
  260.  # HKCU PATH
  261.  final_path = ""
  262.  Win32::Registry::HKEY_CURRENT_USER.open('Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  263.    value = reg['Path']
  264.    for dir in reg['Path'].split(";").sort do
  265.      if File.directory? dir and not final_path[/#{Regexp.escape(dir)}$/i] then final_path << ";" + dir else puts "[+] Entry deleted in User PATH: #{dir}" end
  266.    end
  267.    reg.write('Path', Win32::Registry::REG_SZ, final_path[1..-1])
  268.  end
  269.  
  270.  # HKLM PATH
  271.  final_path = ""
  272.  Win32::Registry::HKEY_LOCAL_MACHINE.open('SYSTEM\CurrentControlSet\Control\Session Manager\Environment', Win32::Registry::KEY_ALL_ACCESS) do |reg|
  273.    value = reg['Path']
  274.    for dir in reg['Path'].split(";").sort do
  275.      if File.directory? dir and not final_path[/#{Regexp.escape(dir)}$/i] then final_path << ";" + dir else puts "[+] Entry deleted in Local PATH: #{dir}" end
  276.    end
  277.    reg.write('Path', Win32::Registry::REG_SZ, final_path[1..-1])
  278.  end
  279.  
  280.  puts "\n[+] PATH is cleaned.\n\n"
  281.  
  282. end
  283.  
  284. logo()
  285. args()
  286.  
  287. exit
852  Programación / Scripting / [RUBY] GameTracker ServerList en: 13 Noviembre 2012, 16:42 pm
  

  GameTracker Server List
  By Elektro H@cker


La idea de Doddy me ha inspirado para crear este script el cual se puede usar por línea de comandos o de forma preconfigurada.
Referencia de la idea de Doddy:  [Perl] Counter Strike 1.6 Servers List








  • Sintaxis::

Código:
GTSL.rb help
(Muestra los valores de "games" y "locations".)

Código:
GTSL.rb (game) (location) (archivo)
(Obtiene todos los servidores del juego "game" del país "location" y los guarda en el archivo "archivo")

O cambiar los dos valores por defecto del script, "game" y "location".


  • Ejemplos de uso
:
Código:
GTSL.rb cs es
(Obtiene todos los servidores españoles del Counter-Strike 1.6 y los guarda en el archivo por defecto "cs-ES servers.txt")

Código:
GTSL.rb cs uk "servidores UK.txt"
(Obtiene todos los servidores ingleses del Counter-Strike 1.6 y los guarda en el archivo "servidores UK.txt")





  •  Game values

  alienswarm    = Alien Swarm
  aa    = America's Army 2.0
  aa3   = America's Army 3
  arma2 = ARMA 2
  arma  = ArmA Armed Assault
  bf1942        = Battlefield 1942
  bf2   = Battlefield 2
  bf2142        = Battlefield 2142
  bf3   = Battlefield 3
  bc2   = Battlefield Bad Company 2
  bfv   = Battlefield Vietnam
  brink = Brink
  cod   = Call of Duty
  cod2  = Call of Duty 2
  cod4  = Call of Duty 4
  blackops      = Call of Duty : Black Ops
  mw3   = Call of Duty : Modern Warfare 3
  uo    = Call of Duty United Offensive
  codww = Call of Duty World at War
  cs    = Counter Strike 1.6
  csgo  = Counter Strike Global Offensive
  css   = Counter Strike Source
  czero = Counter-Strike Condition Zero
  crysis        = Crysis
  crysis2       = Crysis 2
  warhead       = Crysis Wars
  rordh = Darkest Hour
  dod   = Day of Defeat
  dods  = Day of Defeat Source
  dayz  = DayZ
  doom3 = Doom 3
  etqw  = Enemy Territory Quake Wars
  fear  = F.E.A.R.
  ff    = Fortress Forever
  ffow  = Frontlines Fuel of War
  garrysmod     = Garry's Mod
  hl    = Half Life 1
  hl2dm = Half-Life 2 Deathmatch
  halo  = Halo
  homefront     = Homefront
  ins   = Insurgency
  killingfloor  = Killing Floor
  l4d   = Left 4 Dead
  left4dead2    = Left 4 Dead 2
  moh   = Medal of Honor
  mohaa = Medal of Honor Allied Assault
  bt    = Medal of Honor Breakthrough
  sh    = Medal of Honor Spearhead
  mohw  = Medal of Honor Warfighter
  minecraft     = Minecraft
  mnc   = Monday Night Combat
  mumble        = Mumble
  hlns  = Natural Selection
  qw    = Quake 1 (Quake World)
  q2    = Quake 2
  q3    = Quake 3
  q4    = Quake 4
  ravaged       = Ravaged
  ro2   = Red Orchestra 2
  ror   = Red Orchestra Ostfront 41-45
  s8prejudicepc = Section 8 Prejudice
  s8prejudice   = Section 8 Prejudice (xbox)
  sniperelite2  = Sniper Elite V2
  sof2  = Soldier of Fortune II
  swbf2 = Star Wars Battlefront 2
  swjk  = Star Wars Jedi Knight
  swat4 = SWAT 4
  tf2   = Team Fortress 2
  tfc   = Team Fortress Classic 1.6
  teamspeak     = TeamSpeak
  ts3   = TeamSpeak 3
  ut    = Unreal Tournament
  ut2k4 = Unreal Tournament 2004
  ut3   = Unreal Tournament 3
  urbanterror   = Urban Terror
  ventrilo      = Ventrilo
  et    = Wolfenstein Enemy Territory
  wolf  = Wolfenstein PC
  hl2zp = Zombie Panic! Source



  •  Location values

  AF = Afghanistan
  AX = Aland Islands
  AL = Albania
  DZ = Algeria
  AS = American Samoa
  AD = Andorra
  AO = Angola
  AI = Anguilla
  A1 = Anonymous Proxy
  AG = Antigua and Barbuda
  AR = Argentina
  AM = Armenia
  AW = Aruba
  AU = Australia
  AT = Austria
  AZ = Azerbaijan
  BS = Bahamas
  BH = Bahrain
  BD = Bangladesh
  BB = Barbados
  BY = Belarus
  BE = Belgium
  BZ = Belize
  BJ = Benin
  BM = Bermuda
  BT = Bhutan
  BO = Bolivia
  BA = Bosnia and Herzegovina
  BW = Botswana
  BV = Bouvet Island
  BR = Brazil
  IO = British Indian Ocean Territory
  BN = Brunei Darussalam
  BG = Bulgaria
  BF = Burkina Faso
  BI = Burundi
  KH = Cambodia
  CM = Cameroon
  CA = Canada
  CV = Cape Verde
  KY = Cayman Islands
  CF = Central African Republic
  TD = Chad
  CL = Chile
  CN = China
  CX = Christmas Island
  CC = Cocos (Keeling) Islands
  CO = Colombia
  KM = Comoros
  CG = Congo
  CD = Congo, The Democratic Republic of the
  CK = Cook Islands
  CR = Costa Rica
  CI = Cote D'Ivoire
  HR = Croatia
  CU = Cuba
  CY = Cyprus
  CZ = Czech Republic
  DK = Denmark
  DJ = Djibouti
  DM = Dominica
  DO = Dominican Republic
  EC = Ecuador
  EG = Egypt
  SV = El Salvador
  GQ = Equatorial Guinea
  ER = Eritrea
  EE = Estonia
  ET = Ethiopia
  FK = Falkland Islands (Malvinas)
  FO = Faroe Islands
  FJ = Fiji
  FI = Finland
  FR = France
  GF = French Guiana
  PF = French Polynesia
  TF = French Southern Territories
  GA = Gabon
  GM = Gambia
  GE = Georgia
  DE = Germany
  GH = Ghana
  GI = Gibraltar
  GR = Greece
  GL = Greenland
  GD = Grenada
  GP = Guadeloupe
  GU = Guam
  GT = Guatemala
  GG = Guernsey
  GN = Guinea
  GW = Guinea-Bissau
  GY = Guyana
  HT = Haiti
  HM = Heard Island And Mcdonald Islands
  VA = Holy See (Vatican City State)
  HN = Honduras
  HK = Hong Kong
  HU = Hungary
  IS = Iceland
  IN = India
  ID = Indonesia
  IR = Iran, Islamic Republic of
  IQ = Iraq
  IE = Ireland
  IM = Isle Of Man
  IL = Israel
  IT = Italy
  JM = Jamaica
  JP = Japan
  JE = Jersey
  JO = Jordan
  KZ = Kazakhstan
  que = Kenya
  KI = Kiribati
  KP = Korea, Democratic People's Republic of
  KR = Korea, Republic of
  KW = Kuwait
  KG = Kyrgyzstan
  LA = Lao People's Democratic Republic
  LV = Latvia
  LB = Lebanon
  LS = Lesotho
  LR = Liberia
  LY = Libya
  LI = Liechtenstein
  LT = Lithuania
  LU = Luxembourg
  MO = Macao
  MK = Macedonia
  MG = Madagascar
  MW = Malawi
  MY = Malaysia
  MV = Maldives
  ML = Mali
  MT = Malta
  MH = Marshall Islands
  MQ = Martinique
  MR = Mauritania
  MU = Mauritius
  YT = Mayotte
  MX = Mexico
  FM = Micronesia, Federated States of
  MD = Moldova, Republic of
  MC = Monaco
  MN = Mongolia
  ME = Montenegro
  MS = Montserrat
  MA = Morocco
  MZ = Mozambique
  MM = Myanmar
  NA = Namibia
  NR = Nauru
  NP = Nepal
  NL = Netherlands
  AN = Netherlands Antilles
  NC = New Caledonia
  NZ = New Zealand
  NI = Nicaragua
  NE = Niger
  NG = Nigeria
  NU = Niue
  NF = Norfolk Island
  MP = Northern Mariana Islands
  NO = Norway
  A0 = Not Found
  OM = Oman
  PK = Pakistan
  PW = Palau
  PS = Palestinian Territory, Occupied
  PA = Panama
  PG = Papua New Guinea
  PY = Paraguay
  PE = Peru
  PH = Philippines
  PN = Pitcairn
  PL = Poland
  PT = Portugal
  PR = Puerto Rico
  QA = Qatar
  RE = Reunion
  RO = Romania
  RU = Russian Federation
  RW = Rwanda
  BL = Saint Barthelemy
  SH = Saint Helena
  KN = Saint Kitts and Nevis
  LC = Saint Lucia
  MF = Saint Martin
  PM = Saint Pierre and Miquelon
  VC = Saint Vincent and the Grenadines
  WS = Samoa
  SM = San Marino
  ST = Sao Tome and Principe
  A2 = Satellite Provider
  SA = Saudi Arabia
  SN = Senegal
  RS = Serbia
  SC = Seychelles
  SL = Sierra Leone
  SG = Singapore
  SK = Slovakia
  SI = Slovenia
  SB = Solomon Islands
  SO = Somalia
  ZA = South Africa
  GS = South Georgia and the South Sandwich Islands
  ES = Spain
  LK = Sri Lanka
  SD = Sudan
  SR = Suriname
  SJ = Svalbard and Jan Mayen
  SZ = Swaziland
  SE = Sweden
  CH = Switzerland
  SY = Syrian Arab Republic
  TW = Taiwan, Province of China
  TJ = Tajikistan
  TZ = Tanzania, United Republic of
  TH = Thailand
  TL = Timor-Leste
  TG = Togo
  TK = Tokelau
  TO = Tonga
  TT = Trinidad and Tobago
  TN = Tunisia
  TR = Turkey
  TM = Turkmenistan
  TC = Turks and Caicos Islands
  TV = Tuvalu
  UG = Uganda
  UA = Ukraine
  AE = United Arab Emirates
  GB = United Kingdom
  US = United States
  UM = United States Minor Outlying Islands
  UY = Uruguay
  UZ = Uzbekistan
  VU = Vanuatu
  VE = Venezuela
  VN = Viet Nam
  VG = Virgin Islands, British
  VI = Virgin Islands, U.S.
  WF = Wallis and Futuna
  EH = Western Sahara
  YE = Yemen
  ZM = Zambia
  ZW = Zimbabwe




Executable: http://exoshare.com/download.php?uid=MHXEVOZYO bsoleto, el nuevo executable está en el comentario de abajo...


GTSL.rb Obsoleto, el nuevo código está en el comentario de abajo...


Saludos
853  Programación / Programación General / [VS] Problema de diseño de orientación en un Textbox, y Highlight en un Listbox en: 10 Noviembre 2012, 21:38 pm
Hola,

Tengo varios fallos en el diseño que no se como arreglar...

El primer problema es este, tengo un listbox horizontal, cuando pincho en el checkbox se seleccionan todos los items, pero no "resaltan", se quedan con un tono gris:


Lo que me gustaría es conseguir este efecto al seleccionar el checkbox:

(Para que resalte el highlight tengo que volver a pinchar en un item después de haber activado el checkbox..., quiero evitar eso.)

He mirado de arriba a abajo los eventos, las propiedades, y el style del xml del listbox pero no doy con la forma de conseguirlo.

También tengo un problema relacionado con el listbox, y es que no tengo ni idea de como sería la mejor forma de almacenar los items seleccionados y descartar los que no han sido seleccionados, para la monitorización.

Código
  1.    Private Sub File_copy_options_Loaded(sender As Object, e As RoutedEventArgs) Handles DrivesBox.Loaded
  2.        DrivesBox.Items.Insert(0, "A ")
  3.        DrivesBox.Items.Insert(1, "B ")
  4.        DrivesBox.Items.Insert(2, "C ")
  5.        DrivesBox.Items.Insert(3, "D ")
  6.        DrivesBox.Items.Insert(4, "E ")
  7.        DrivesBox.Items.Insert(5, "F ")
  8.        DrivesBox.Items.Insert(6, "G ")
  9.        DrivesBox.Items.Insert(7, "H ")
  10.        DrivesBox.Items.Insert(8, "I ")
  11.        DrivesBox.Items.Insert(9, "J ")
  12.        DrivesBox.Items.Insert(10, "K ")
  13.        DrivesBox.Items.Insert(11, "L ")
  14.        DrivesBox.Items.Insert(12, "M ")
  15.        DrivesBox.Items.Insert(13, "N ")
  16.        DrivesBox.Items.Insert(14, "O ")
  17.        DrivesBox.Items.Insert(15, "P ")
  18.        DrivesBox.Items.Insert(16, "Q ")
  19.        DrivesBox.Items.Insert(17, "R ")
  20.        DrivesBox.Items.Insert(18, "S ")
  21.        DrivesBox.Items.Insert(19, "T ")
  22.        DrivesBox.Items.Insert(20, "U ")
  23.        DrivesBox.Items.Insert(21, "V ")
  24.        DrivesBox.Items.Insert(22, "W ")
  25.        DrivesBox.Items.Insert(23, "X ")
  26.        DrivesBox.Items.Insert(24, "Y ")
  27.        DrivesBox.Items.Insert(25, "Z ")
  28.    End Sub
  29.  

Supongo que como dijo cuban lo mejor sería usar una lista de tipo enumeration, pero ni idea tengo.



El segundo problema es sobre mis textboxs:


A simple vista parece estar bien, pero NO, uso la orientación "righttoleft" porque si la ruta es más larga que las dimensiones del textbox no se puede ver el final de la ruta.

Eso no tiene mucha importancia, pero lo que me gustaría es encontrar una forma para saber si el texto sale del rango de las dimensiones del texbox, Es decir:

Si la ruta es corta, quiero que la ruta salga a la izquierda:

(Con el evento "GetKeyboardFocus" cambio temporalmente la orientación a la izquierda para poder editar mejor el texto)

Pero lo único que consigo es que salga a la derecha por la orientación que uso:




Y otro problema que tengo es que no puedo seleccionar el texto con el mouse para "arrastrarlo" por la caja de texto.

A ver como explico esto...


En la imagen de arriba he seleccionado esos caracteres con el mouse, pero no puedo seleccionar lo que hay más a la derecha, porque el campo de texto no se desplaza, está fijo...


Uf, si han leido hasta aquí, muchas gracias!

854  Programación / Programación General / [VS2012] El control FolderBrowserDialog está deshabilitado! en: 9 Noviembre 2012, 19:38 pm
Estoy intentando usar este control en un botón, el form es un WPF, pero por algún motivo que desconozco lo tengo deshabilitado y no puedo usarlo...



¿Alguna idea de porqué no puedo acceder al control?

¿Como podría usar FolderBrowserDialog en ese botón si no puedo acceder a él?, Pues he visto infinitos ejemplos y no he conseguido hacerlo por mi mismo.

Necesito usar el folderbrowser nativo de windows, no me sirve otro (Son muy malos visual e interactivamente hablando), o en su defecto poder hacer este openfiledialog para mostrar/abrir/seleccionar solamente carpetas si fuera posible?:

Código
  1.    Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
  2.  
  3.        Dim dlg As New Microsoft.Win32.OpenFileDialog()
  4.        Dim result As Nullable(Of Boolean) = dlg.ShowDialog()
  5.  
  6.        If result = True Then
  7.            Dim path As TextBox = DirectCast(TryCast(DirectCast(sender, FrameworkElement).Parent, FrameworkElement).FindName("textPath"), TextBox)
  8.            TextBox1.Text = dlg.FileName
  9.            DirectCast(sender, Button).Focus()
  10.        End If
  11.  
  12.    End Sub

Gracias por leer.
855  Programación / Programación General / [VS2012] Como bindear esta variable en un WPF? en: 8 Noviembre 2012, 12:17 pm
Hola,

Tengo un problema, no se como puedo bindear una variable, estoy intentando modificar el texto por defecto de un textbox...

PD: Es un WPF.


En el form del mainwindow:

Código
  1. Public Sub Button_Click_2(sender As Object, e As RoutedEventArgs)
  2.  
  3.    Dim usbmon_path As String
  4.    usbmon_path = System.IO.Directory.GetCurrentDirectory & "\USB MON"
  5.  
  6.    Dim W2 As New Window2
  7.    W2.Show()
  8.  
  9. End Sub

(Eso crea la variable usbmon_path, y abre el "window2", bien)



en el window2.xaml::

Código
  1. <TextBox ..blabla...  Text="{Binding usbmon_path}"  ...blabla/>



No me sale ningún error, pero el texto sale vacío, ¿Que estoy haciendo mal?

gracias por leer!
856  Programación / Programación General / [Aporte] [VS2012] Mouse XY (Devuelve las coordenadas del mouse) en: 7 Noviembre 2012, 23:19 pm
Hola,

Este es mi primer programa en VisualStudio2012, así que no me critiqueis mucho xD, he intentado hacerlo lo mejor posible, y es un programa muy sencillo :P



Resubidos:
Descarga:  http://ElektroStudios.tk/MouseXY.exe
Source: http://ElektroStudios.tk/MouseXY.zip

Acepto consejos, o lo que séa!

un saludo
857  Programación / Programación General / (Solucionado) [VS2012] ¿Como hacer un form con "borderstyle = none" moveable en: 7 Noviembre 2012, 14:40 pm
Hola,

Estoy aprendiendo este lenguaje y ya tengo mi primera app creada, pero me falta un detalle que no consigo, poder mover la ventana del form con "borderstyle=none"

He buscado en google pero solo encuentro referencias antiguas para VB y VS2005, y no he sabido como acoplarlas a mi app la verdad, siempre me da error de "hWND".

¿Alguien me hecha una mano?

Código
  1. Public Class Form1
  2.    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
  3.        Label2.Text = "X: " & MousePosition.X
  4.        Label3.Text = "Y: " & MousePosition.Y
  5.    End Sub
  6.  
  7.    Sub Form1_KeyPress(ByVal sender As Object, _
  8.      ByVal e As KeyPressEventArgs) Handles Me.KeyPress
  9.        If e.KeyChar >= ChrW(3) Then
  10.            Clipboard.SetDataObject(Label2.Text & " " & Label3.Text)
  11.        End If
  12.    End Sub
  13.  
  14.    Private Sub Form1_MouseMove(sender As Object, e As MouseEventArgs)
  15.        ' SUPONGO QUE ESTE ES EL EVENTO CORRECTO PARA MI PROPÓSITO...
  16.    End Sub
  17. End Class

Un saludo!
858  Programación / Scripting / (Tema bloqueado hasta finalizar el tuto) Tutorial extendido de aprendizaje Batch en: 4 Noviembre 2012, 15:25 pm
    EL TUTORIAL Y EL ÍNDICE ESTÁN EN PROCESO...





    ÍNDICE

    Pincha en un tema para ir directamente.

    • Página 1

    • 1. DEFINICIONES

                   Lenguaje de programación
                   Procesamiento por lotes
                   Script
                   Comando
                   CMD (o Consola) (o Shell) (o DOS) (o Símbolo de sistema)
                   BATCH
                   Archivo BAT
                   CLI (CommandLineInterface)
                   Subrutina
                   Argumento (o Parámetro)
                   Variable
                   Variable de entorno de Windows
                   PATH (Variable de entorno de Windows)
                   String (o Cadena)
                   Concatenación
                   Expresión
                   Expresión regular (o REGEXP, o Patrón)
                   Operador
                   Pseudocódigo

    • 2. CONSEJOS ANTES DE COMENZAR

                   Defínemelo otra vez
                   Pregúntaselo a la CMD (Help, /?, -h, -help)
                   En busca del error
                   Productividad 1 (Editores de código)
                   Productividad 2 (Plantillas)
                   Práctica (Retos)
                   Ética

    • 3. LOS PRIMEROS PASOS

                   3.1 Una identidad (Title)[/li][/list]
                   3.2 La voz (Echo, Echo:, Echo+)
                   3.3 El silencio (@, Echo OFF, >NUL)
                   3.4 La escritura ("")
                   3.5 La lectura (REM)
                   3.6 Caminar (GOTO, Pause)
                   3.7 Memorizar (Set)

    • 4. OPERADORES

                   4.1 Operadores de Ejecución condicional   (& && ||)
                   4.2 Operadores de Ejecución condicional simulada  (&= ^= |=)
                   4.3 Operadores de Exclusión (^)
                   4.4 Operadores de Agrupación  ( () )
                   4.5 Operadores de comparación (o Condicionales) (== EQU NEQ LSS LEQ GTR GEQ)
                   4.6 Operadores de desplazamiento lógico (o Redireccionamiento) (> >> < |)
                   4.7 Operadores aritmétricos y de asignación (+ - * / % = += -= *= /= %= >>= <<=)
                   4.8 Otros operadores (@ :: "" % ! ? * . .. \)



    • 6. VARIABLES

                   6.1 Variables especiales (o variables de parámetro) (o variables de argumento)  (%0 %*)
                   6.2 Variables Standard (%%)  (SET, SET /A, SET /P)
                   6.3 Variables expandidas (!!)   (SETLOCAL ENABLEDELAYEDEXPANSION)
                   6.4 Variables de entorno (%%)
                   6.5 Variables de FOR  (%%a)


    compmaraciones
    búcles
    subrutinas
    • 5. SINTAXIS

    comandos
    859  Foros Generales / Sugerencias y dudas sobre el Foro / Insertar fuente "Lucida Console" en un post en: 1 Noviembre 2012, 13:16 pm
    Hola, estoy escribiendo un tutorial y me gustaría cambiar la fuente en una lista de texto por la fuente "Lucida Console" (Imagino que la fuente estará disponible) de este modo no habrá espacios entre las tabulaciones etc, vamos, que se verá bien y todo con su correcto margen entre cada letra como si usase la etiqueta "code" con esa lista, ese mismo margen entre las letras quiero...

    He probado así, pero no me funciona:
    [ font = Lucida Console ]Test[ /font ]
    [ font = Lucida_Console ]Test[ /font ]
    [ font = Lucida ]Test[ /font ]
    [ font = Lucon ]Test[ /font ]

    ¿Cual es el valor correcto que debo usar? :-/

    EDITO: una pregunta tonta... ¿el cambio solo afectaría a los que dispongan de la fuente lucida console, o de eso se encarga el server?

    Gracias!
    860  Informática / Software / Busco el ActiveTCL 8.5 u 8.4.4 en: 26 Octubre 2012, 09:05 am
    Hola,

    ¿Alguien sabe donde encontrar EXACTAMENTE la versión estable 8.5.0 de Active TCL? o en su defecto la versión 8.4.4?...

    PD: Ya miré aquí: http://downloads.activestate.com/ActiveTcl/releases/

    Estaría muy agradecido.
    Saludos
    Páginas: 1 ... 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 [86] 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ... 105
    WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines