inetsilver Geschrieben 19. Februar 2002 Geschrieben 19. Februar 2002 Wie kann man mit C die Daten in der Systemregistry erfassen? Welche Befehle und so kann, muss man dafür verwenden? Und wie kann man dann diese an einen Server schicken damit sie dann in eine Datenbank geschrieben werden? Zitieren
gugelhupf Geschrieben 19. Februar 2002 Geschrieben 19. Februar 2002 Das sind ja gleich 3 Sachen auf einmal, das geht nun wirklich nicht *ggg* Spass beiseite. Daten aus der Reg zu lesen is einfach, diese dann zu "verschicken" und zu speichern...naja...du kannst das mit sockets und ner DB auf Serverseite lösen...wird aber nicht ganz trivial und wird mit Sicherheit sehr zeitaufwendig sein.... Zitieren
Crush Geschrieben 19. Februar 2002 Geschrieben 19. Februar 2002 C-Basis: Registry Functions This section provides the definitions for the registry functions. HKEY_TYPE REGSAM SHDeleteEmptyKey SHDeleteKey SHDeleteValue SHEnumKeyEx SHEnumValue SHGetValue SHOpenRegStream SHQueryInfoKey SHQueryValueEx SHRegCreateUSKey SHREGDEL_FLAGS SHRegDeleteEmptyUSKey SHRegDeleteUSValue SHREGENUM_FLAGS SHRegEnumUSKey SHRegEnumUSValue SHRegGetUSValue SHRegOpenUSKey SHRegQueryInfoUSKey SHRegQueryUSValue SHRegSetUSValue SHRegWriteUSValue SHSetValue Oder mit C++: CRegKey Class Members Methods Attach Attaches a registry key handle to the CRegKey object. Close Releases m_hKey. Create Creates or opens the specified key. CRegKey Constructor. DeleteSubKey Deletes the specified key. DeleteValue Deletes a value field of the key identified by m_hKey. Detach Detaches m_hKey from the CregKey object. Open Opens the specified key. QueryValue Retrieves the data for a specified value field. RecurseDeleteKey Deletes the specified key and explicitly deletes all subkeys. SetKeyValue Stores data in a specified value field of a specified key. SetValue Stores data in a specified value field. Operators operator HKEY Converts a CRegKey object to an HKEY. Data Members m_hKey Contains a handle of the registry key associated with the CRegKey object. CRegKey Overview Über Sockets mit CObjects wäre eine geschickte Kombination: CSocketFile::CSocketFile CSocketFile( CSocket* pSocket, BOOL bArchiveCompatible = TRUE ); Parameters pSocket The socket to attach to the CSocketFile object. bArchiveCompatible Specifies whether the file object is for use with a CArchive object. Pass FALSE only if you want to use the CSocketFile object in a stand-alone manner as you would a stand-alone CFile object, with certain limitations. This flag changes how the CArchive object attached to the CSocketFile object manages its buffer for reading. Remarks Constructs a CSocketFile object. The object’s destructor disassociates itself from the socket object when the object goes out of scope or is deleted. Note A CSocketFile can also be used as a (limited) file without a CArchive object. By default, the CSocketFile constructor’s bArchiveCompatible parameter is TRUE. This specifies that the file object is for use with an archive. To use the file object without an archive, pass FALSE in the bArchiveCompatible parameter. In its “archive compatible†mode, a CSocketFile object provides better performance and reduces the danger of a “deadlock.†A deadlock occurs when both the sending and receiving sockets are waiting on each other, or for a common resource. This situation might occur if the CArchive object worked with the CSocketFile the way it does with a CFile object. With CFile, the archive can assume that if it receives fewer bytes than it requested, the end of file has been reached. With CSocketFile, however, data is message based; the buffer can contain multiple messages, so receiving fewer than the number of bytes requested does not imply end of file. The application does not block in this case as it might with CFile, and it can continue reading messages from the buffer until the buffer is empty. The CArchive::IsBufferEmpty function is useful for monitoring the state of the archive’s buffer in such a case. For more information on the use of CSocketFile, see the articlesWindows Sockets: Using Sockets with Archives andWindows Sockets: Example of Sockets Using Archives in Visual C++ Programmer’s Guide. Die Daten als Document: CDocument::OnFileSendMail void OnFileSendMail( ); Oder direkt eine MAPI-Message versenden: MapiMessage (Simple MAPI) A MapiMessage structure contains information about a message. Quick Info Header file: MAPI.H typedef struct { ULONG ulReserved; LPTSTR lpszSubject; LPTSTR lpszNoteText; LPTSTR lpszMessageType; LPTSTR lpszDateReceived; LPTSTR lpszConversationID; FLAGS flFlags; lpMapiRecipDesc lpOriginator; ULONG nRecipCount; lpMapiRecipDesc lpRecips; ULONG nFileCount; lpMapiFileDesc lpFiles; } MapiMessage, FAR *lpMapiMessage; Members ulReserved Reserved; must be zero. lpszSubject Pointer to the text string describing the message subject, typically limited to 256 characters or less. If this member is empty or NULL, the user has not entered subject text. lpszNoteText Pointer to a string containing the message text. If this member is empty or NULL, there is no message text. lpszMessageType Pointer to a string indicating a non-IPM type of message. Client applications can select message types for their non-IPM messages. Clients that only support IPM messages can ignore the lpszMessageType member when reading messages and set it to empty or NULL when sending messages. lpszDateReceived Pointer to a string indicating the date when the message was received. The format is YYYY/MM/DD HH:MM, using a 24-hour clock. lpszConversationID Pointer to a string identifying the conversation thread to which the message belongs. Some messaging systems can ignore and not return this member. flFlags Bitmask of message status flags. The following flags can be set: MAPI_RECEIPT_REQUESTED A receipt notification is requested. Client applications set this flag when sending a message. MAPI_SENT The message has been sent. MAPI_UNREAD The message has not been read. lpOriginator Pointer to a MapiRecipDesc structure containing information about the sender of the message. nRecipCount The number of message recipient structures in the array pointed to by the lpRecips member. A value of zero indicates no recipients are included. lpRecips Pointer to an array of MapiRecipDesc structures, each containing information about a message recipient. nFileCount The number of structures describing file attachments in the array pointed to by the lpFiles member. A value of zero indicates no file attachments are included. lpFiles Pointer to an array of MapiFileDesc structures, each containing information about a file attachment. Alles von der MSDN... Allerdings kannst Du wenn alles direkt in eine Datenbank soll auch mit ODBC-Schnittstellen arbeiten oder halt direkt die DB-Klassen des Herstellers verwenden, falls dieser etwas anbietet (sind meist einfacher zu bedienen, jedenfalls bei Oracle T-Net). Zitieren
inetsilver Geschrieben 19. Februar 2002 Autor Geschrieben 19. Februar 2002 wo soll man da nur anfangen, warum klingt das immer so leicht und ich hab keinen Plan davon ;-( ihr AEler müßt sowas wohl öfters machen. nun gut ich werde mal mein glück versuchen ;-) Zitieren
Empfohlene Beiträge
Dein Kommentar
Du kannst jetzt schreiben und Dich später registrieren. Wenn Du ein Konto hast, melde Dich jetzt an, um unter Deinem Benutzernamen zu schreiben.