 |
|
|
 |
|
 |
Hi,
How can I get this snippet to work with links with pages and variable info for example this link wont even work in this app.
www.domain.com/test.aspx?operatorid=1
This gives me server name or address cannot be validated
Any help would be great thanks!
|
|
|
|
 |
|
 |
i've done some tests and find out that it doesn't send any GET vars!..
e.g.
http://www.codeproject.com/script/comments/user_new.asp?main=/tools/hextract.asp&df=100&forumid=16199
it is interpreted the same as
http://www.codeproject.com/script/comments/user_new.asp
could it be improved to send GET variables?.
thanks in advance!.
|
|
|
|
 |
|
 |
I am looking for this feature too.
Did u find any solution?
Where there is a WISH, there is a WILL.
|
|
|
|
 |
|
 |
This code is great, but it can only open the default page in a web site, I add some code into the function void CHeaderExtractDlg::OnBnClickedOk(), and make it can send request to any page in a web site. The following is the updated code, by the way, please add #include "atlutil.h" next to the #include "stdafx.h". The value in URL field should change to real URL, for example http://www.codeproject.com/script/comments/user_new.asp void CHeaderExtractDlg::OnBnClickedOk() { //All the work of the application happens here // We will get the raw data of the information into the thing and have people // that you can get the HTTP pages raw data // // Copyright 2003 by Sam Contapay CInternetSession ISession; CHttpConnection* pConnection = NULL; CString strURL; CString Header, Data, Temp; Temp.Empty(); Data.Empty(); //Clear the edit box if anything is in there SetDlgItemText(IDC_RESULT, ""); //Get the URL string GetDlgItemText(IDC_URL_TEXT, strURL); CUrl cHTTPUrl; if (!cHTTPUrl.CrackUrl((LPCTSTR)strURL)) { //Invalid URL AfxMessageBox("The URL is invalid.", MB_ICONERROR); return; } CString strHost = cHTTPUrl.GetHostName(); CString strPath = cHTTPUrl.GetUrlPath(); if (strPath[0] != '/') strPath = '/' + strPath; pConnection = ISession.GetHttpConnection((LPCTSTR)strHost); if (pConnection==NULL) { //Unable to open the damn connection to the server //what the hell AfxMessageBox("Unable to Open connection to server. Please check your internet connection and the URL.", MB_ICONERROR); return; } //We got this far so something is open all we need todo is retrieve //the information and put it in the damn box CHttpFile* pURLFile = pConnection->OpenRequest("GET", (LPCTSTR)strPath); pURLFile->SendRequest(); pURLFile->SetReadBufferSize(MAX_READ_SIZE); while (pURLFile->ReadString(Temp)) { Data+=Temp+"\r\n"; } //int TotalBytes = pURLFile->Read(Buffer, MAX_READ_SIZE); pURLFile->QueryInfo(HTTP_QUERY_RAW_HEADERS_CRLF, Header); //Data.SetString(Buffer, TotalBytes); //Get rid of the weird square thing //Data.Replace("\n", "\r\n"); SetDlgItemText(IDC_DATA, Data); SetDlgItemText(IDC_RESULT, Header); pURLFile->Close(); delete pURLFile; pConnection->Close(); delete pConnection; ISession.Close(); }
|
|
|
|
 |
|
 |
I appreciate the code snippet let me put it in the new code and update the article with credit to you as well as in the source. Thanks!
WOW I just reread the comments in the source part and I didn't know I put those comments in I must have needed some caffeine or soemthing at the time. Wow was I cranky!
Code4Food
----
"There is no try; only do or do not"
-Yoda
|
|
|
|
 |
|
 |
What is CURL . Kindly explain . Its not an MFC class.
Thanks
Kiran chikhale
|
|
|
|
 |
|
 |
Hi ! This article is very interesting but it lacks PROXY support. How to implement this ?
Regards.
|
|
|
|
 |
|
 |
Thanks I didn't even think about that. Let me review it tonight and see if I can get something up that supports PROXY use.
Code4Food
----
"There is no try; only do or do not"
-Yoda
|
|
|
|
 |
|
|
 |
|
 |
Thank you your comments are greatly appreciated. Also you have a great article there. Does it parse the information from the web page it recieves? (i.e. Google translator) I may have to ask you questions in the near future . I have to write a web page information extractor. But first I will download your source and see if I can create something
Code4Food
----
"There is no try; only do or do not"
-Yoda
|
|
|
|
 |
|
 |
Code4Food wrote:
Does it parse the information from the web page it recieves?
Yes, it makes it easy to do this. I've used the WRP to build a real-time portfolio management system. You can find it at my "Freeware" link.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
 |
|
 |
Please let me know who you are The reason is I have been coding as a one man shop my whole life and I would love to partner up with someone to bounce around some code ideas. The webserver is not meant to take the place of IIS/Apache but is mostly a learning expierence. I would finally like to be involved with some people and actually do some code design. Skill level is not important, but you must be able to do a "hello world" program and contribute by either doing research or voicing your opinion on how we should build a webserver. More details are available once I know you are interested.
If you are interested please reply or send me an email at samc@stuffsoft.com.
Code4Food
----
"There is no try; only do or do not"
-Yoda
|
|
|
|
 |
|
 |
Code4Food wrote:
The webserver is not meant to take the place of IIS/Apache but is mostly a learning expierence
Its funny you should mention this. Writing a webserver was my first real 'learn .net' project.
Not sure I'd want to share the could though as it might be a bit embarassing!!!
Why don't you do the design process as a series of articles? People round here are normally quite free with their caustic criticism friendly help and advice!
|
|
|
|
 |
|
 |
Hi
Will do. I didn't think anyone would like to see an article on my laughable attempt at writing a webserver. But you are right it is the feedback I really want I want to actually talk with peers and get some feedback to designing one. Working as a one man shop - I don't know if I can work in a team, and this may sound stupid but my dream as a programmer is just to work in a team enviornment.
Code4Food
----
"There is no try; only do or do not"
-Yoda
|
|
|
|
 |
|
 |
Hi Code4Food!
Code4Food wrote:
but my dream as a programmer is just to work in a team enviornment
Be happy that you can do your job on your own! In a team are always people who think that they know everything better. Sometimes you have advantages while working in a team, but to realize your ideas and your "code-dreams" its always better working on your own...
Sites like codeproject.com helps you to share ideas and ask some important questions, but the last words are from you - and nobody else!
cya,
Rider99 (I have to work in a team - man, its horrible )
____________________________
Rule #1: code doesn't lie!
Rule #2: code never lies!
Rule #3: if the docs are incorrect -> take a look at the code!
|
|
|
|
 |
|
 |
Is it really that horrible? Some of my local peers says that working in a team enviornment is a great expierence, and two sets of eyes are better then one. You can have someone to review your code or bounce new ideas off of them. For example, I could be brute forcing something, and a teammate comes in and says "Hey, Sam, look into this algorithm" and provide a more manageable and maintanable solutions.
I know I am guilty of "coding on the fly" but without someone else to worry about, and not even caring about anyone who has to maintain the code down the line (since I do not have that teamplay attitude) I just feel a group enviornment would only help me to grow as a developer. Maybe I will look into an OSS project, but most of them are not on Windows (sorry, my platform of choice, no zealot rhetoric from me, I just prefer Windows).
Code4Food
----
"There is no try; only do or do not"
-Yoda
|
|
|
|
 |
|
 |
I Was writing a webserver recently. But have to rewrite the NetworkEngine, since it's too full of race conditions. It has some nice features like being able to run the same plugins that IIS uses.
It has no reference to dotNet though. (plain C++)
I would like to hear from you. Cheers Hugo Hallman
|
|
|
|
 |
|
 |
Hugo
I would definetly like to hear from you I am getting ready for work, once I get a little break I'll send you an email!
Code4Food
----
"There is no try; only do or do not"
-Yoda
|
|
|
|
 |
|
 |
Hi check this link http://www.codeproject.com/internet/ExtendibleServer.asp For a webserver.
or http://www.codeproject.com/internet/HTTPGet-Post.asp for a client. I made an attempt to make this client using non-blocking sockets, it works now, and it doesn't hang when ip adres can be found. If any one wants it, I shall put it on codetools as well. Or if no one seems to want it, I maybe put it up anyway :-p Greetings from The Netherlands
|
|
|
|
 |
|
 |
Thanks when I get back from work I am definetly going to look into those links
Code4Food
----
"There is no try; only do or do not"
-Yoda
|
|
|
|
 |
|
 |
Sam
I came across your article on codeproject. Are still looking for someone collaborate on building a web server application? I have been working on a web server based on Paul Hethmon's book "Illustrated Guide to HTTP." This book provides some examples but I had to modify them to run on Windows. I also added support for SSL with OpenSSL and support for server side includes. I am having problems with the sever side includes. I was hoping we could share ideas.
Marcus Carey
|
|
|
|
 |