![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|
|
#1
|
|||
|
|||
|
y con InstallShield??
He visto en este foro a otras persona que mas o menos les pasa lo mismo y he visto que con este intalador puedes crear las dns. Voy a probar y ya os comento como me ha ido. De todos modos si me puedes facilitar más información sobre los que me has comentado te lo agradecería mucho para estudiarlo este fin de semana. Muchas gracias por todo
|
|
#2
|
||||
|
||||
|
Si, hay mucha documentacion, puedes verla en la ayuda de delphi, sobre la clase TRegistry.
Es bastante sencillo, incluyes la unit registry en el formulario, te creas un objeto de tipo TRegistry, le asignas el root key con el que vas a trabajar, en su propiedad root, lees los valores con readstring, y si no existe los creas con writestring. En la ayuda, como te comente, puedes ver ejemplos bien ilustra_tivos.
__________________
Héctor Geraldino Software Engineer |
|
#3
|
|||
|
|||
|
interesante esto del registro
Bueno, bueno, pues si que está interesante esto del registro...
Intentaré hacer la conexion dns haber que tal... De todos modos he encontrado dos funciones muy buenas para leer y escribir en el registro. Os pongo aquí el linkhttp://www.latiumsoftware.com/es/delphi/00004.php espero que os sirvan igual que me han servido a mi. Ya os contaré cómo me ha ido. Muchiiiiiiiisimas gracias |
|
#4
|
|||
|
|||
|
Parece que el enlace no funciona
Como parece que el enlace no funciona os pongo aquí las dos funciones:
Para leer el registro: function GetRegistryData(RootKey: HKEY; Key, Value: string): variant; var Reg: TRegistry; RegDataType: TRegDataType; DataSize, Len: integer; s: string; label cantread; begin Reg := nil; try Reg := TRegistry.Create(KEY_QUERY_VALUE); Reg.RootKey := RootKey; if Reg.OpenKeyReadOnly(Key) then begin try RegDataType := Reg.GetDataType(Value); if (RegDataType = rdString) or (RegDataType = rdExpandString) then Result := Reg.ReadString(Value) else if RegDataType = rdInteger then Result := Reg.ReadInteger(Value) else if RegDataType = rdBinary then begin DataSize := Reg.GetDataSize(Value); if DataSize = -1 then goto cantread; SetLength(s, DataSize); Len := Reg.ReadBinaryData(Value, PChar(s)^, DataSize); if Len <> DataSize then goto cantread; Result := s; end else cantread: raise Exception.Create(SysErrorMessage(ERROR_CANTREAD)); except s := ''; // Deallocates memory if allocated Reg.CloseKey; raise; end; Reg.CloseKey; end else raise Exception.Create(SysErrorMessage(GetLastError)); except Reg.Free; raise; end; Reg.Free; end; Para llamar a esta funcion por ejemplo: ShowMessage(GetRegistryData(HKEY_LOCAL_MACHINE, '\SOFTWARE\ODBC\ODBC.INI\pelicula', 'SourceDB')); Para escribir en el registro: procedure SetRegistryData(RootKey: HKEY; Key, Value: string; RegDataType: TRegDataType; Data: variant); var Reg: TRegistry; s: string; begin Reg := TRegistry.Create(KEY_WRITE); try Reg.RootKey := RootKey; if Reg.OpenKey(Key, True) then begin try if RegDataType = rdUnknown then RegDataType := Reg.GetDataType(Value); if RegDataType = rdString then Reg.WriteString(Value, Data) else if RegDataType = rdExpandString then Reg.WriteExpandString(Value, Data) else if RegDataType = rdInteger then Reg.WriteInteger(Value, Data) else if RegDataType = rdBinary then begin s := Data; Reg.WriteBinaryData(Value, PChar(s)^, Length(s)); end else raise Exception.Create(SysErrorMessage(ERROR_CANTWRITE)); except Reg.CloseKey; raise; end; Reg.CloseKey; end else raise Exception.Create(SysErrorMessage(GetLastError)); finally Reg.Free; end; end; Para llamar a esta funcion: SetRegistryData(HKEY_LOCAL_MACHINE, '\SOFTWARE\ODBC\ODBC.INI\pelicula', 'BackgroundFetch', rdString, 'Sí'); |
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
|