|
>> where you can write in lots of different
>> usernames and passwords
>> the registry is where i do that?
If this is going to be a production product then I would seriously advise against that. Storing passwords a clear text anywhere is not going to be considered acceptable.
As I stated previously, security is a large subject, you can't really know until you start to investigate it. There are so many resources available these days on the net for reading about software security issues. You really should take some time to understand the subject more thoroughly.
But, that's just my opinion… I could be wrong.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I agree this is definitly an area where security is a must and the data must be encrypted. Storing unencrypted values in the registry is not much better than storing them in a file named passwords...
John
|
|
|
|
|
Does anyone know a good site for learning how to edit the registry from inside a program?
thx
|
|
|
|
|
The CRegKey class is what you want to use:
// Read a DWORD from the registry
DWORD dwValue = 0;
CString csKEY = "Software\\Company";
CRegKey key;
if ( key.Open(HKEY_LOCAL_MACHINE, csKEY, KEY_READ) == ERROR_SUCCESS)
{
if (key.QueryDWORDValue("MyKey", dwValue) == ERROR_SUCCESS)
AfxMessageBox("You read it into dwValue");
key.Close();
}
// Write a DWORD to the registry
DWORD dwValue = 3;
CString csKEY = "Software\\Company";
CRegKey key;
if ( key.Create(HKEY_LOCAL_MACHINE, csKEY) == ERROR_SUCCESS)
{
if (key.SetDWORDValue("MyKey", dwValue) == ERROR_SUCCESS)
AfxMessageBox("You wrote it");
key.Close();
}
|
|
|
|
|
Man you folks are awesome! that looks just like what i need... a bitto fanagling and it should be perfect!!
thx
|
|
|
|
|
(still stuck
I am having a bit of trouble running CInternetFile::WriteString() and seeing results appear on the server file I am trying to change.
Here is a snipet of code that open the HTTP Connection, then opens a CInternetFile pointer then sends a request to write data (I hope). "strData" is the data I am sending.
pServer = session->GetHttpConnection("www.myserver.com", 80, "username", "password");
pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_POST, "/folder/file.txt");
pFile->SendRequestEx(strData.GetLength());
pFile->QueryInfoStatusCode(dwRet);
pFile->WriteString(strData);
pFile->EndRequest();
Does anyone see any problems with what I have here? I am kinda basing this off an example I found but the file I am trying to write to is not affected. The permissions on the file are set to a+rwx but I am wondering if there is something in the code I am missing or perhaps on the server. I can read from the file just fine. I just can't write to it.
Thanks!
|
|
|
|
|
You need to find some information on HTTP and read about it. You can't update a file on the server using HTTP. You have to add that capability by introducing the behavior on the Server. There are a number of methods for doing this. You need to study the problem.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I understand. This was something I questioned myself thinking I shouldn't be able to update using HTTP but perhaps I could using FTP or some other means. I tried looking for up whatever information I could on CInternetFile but in everything I see, I get the same example and it tells me what I have done should work, but I believe you. I don't think it's that easy. So, in general, I'm a little stuck on what I should be reading. Do you recommend any articles? Sites? Thanks!
|
|
|
|
|
If you are attempting to create a file named file.text within your /folder virtual, you can do that with your code by making 2 changes. First, change the HTTP_VERB_POST to HTTP_VERB_PUT. Second, you must ensure the virtual directory named /folder on your web server allows write privileges.
But you would be better off not allowing write access to a virtual and using a post to an ASP page on that virtual. Within that ASP page, you could take the posted data and create a file.
|
|
|
|
|
Yes my previous post was incorrect. Since IIS4 the PUT command is supported. I don't know about other servers. There is good information on that here:
IIS HTTP PUT
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
How rude of me! I forgot to say "Thanks". Thanks for not letting me pass out bad information.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I remember there was this wonderful tool for setting up AfxMessageBox/MessageBox dialogs. I can't find it here and thought this was were I downloaded it. Does anyone know where this application is?
Thanks!
|
|
|
|
|
You mite be talking about the XMessageBox By Hans Dietrich (@codeproject). There was a messagebox (@codeproject) that used RTF to display the message using multiple colors, but I do not seem to be able to find that one.
INTP
|
|
|
|
|
nope. This was an actual application that would appear in the Tools menu that pops open a dialog box and lets you build an AfxMessageBox/MessageBox by simply filling in the form. It would then give you the code you must place in your program for the MessageBox you built.
|
|
|
|
|
There is one on CodeGuru:
here
-----------------------------
Get trial copy of comment generating tool CommentMakerPro, std::string and std::string containers viewer FeinEvaluatorPro and windows manager for Microsoft Visual Studio .NET FeinWindows at www.FeinSoftware.com
|
|
|
|
|
that's it! Thanks. I guess I didn't look hard enough.
|
|
|
|
|
can anyone tell me how to read a file by C++ coding?
and then i want to convert the upper case word in the file to a lower case.
after that,i want to count how many time the words repeat in the file,and the propability the words occur.hope some one can help me.....
thank to does can help me....god blesh u......
|
|
|
|
|
|
Didn't they supply you with a text book for the course that teaches you how to do that?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Should you still get credit for the assignment if someone else does your work?
|
|
|
|
|
Isn't this also a way of learning
|
|
|
|
|
The ability to read and comprehend is a prerequisite for using a book. (Sometimes I really wonder what the hell "students" are doing)
--
Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr.
Welle: Erdball - F104-G Starfighter
|
|
|
|
|
|
I can start a blank project, and have no problem using <complex> with anything I add. I can include it in the first source file I create, I can add a form to the project and use it in the form code file, I can link these things together, etc.
If I start a Net project I can add a generic C++ class and use <complex> therein, but any time I ntry to link this file to anything I get link errors. If I use <complex> in a form's code, or any other type of managed file, I get these same errors. I can copy code from another such project that I download, which works just fine, intop my own project, and it fails. These are typical.
delete3 fatal error LNK1120: 2 unresolved externals
delete3 error LNK2020: unresolved token (0A000016) delete
delete3 error LNK2020: unresolved token (0A000006) _CxxThrowException
Why?
I should mention that this is in VS 2003
Help please
|
|
|
|
|
If your are using static lib of you own (earlier version like VC 6 or 5) in VC.NET managed project. You will get some linker errors. Remedy is you need to rebuild your static lib with VC.NET.
Sonork 100.41263:Anthony_Yio
|
|
|
|