|
Did they stop selling MSDN subscriptions? :p
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
LOL - no, but the OP I reckon wants to buy a box with the VS2008 DVDs, posters, etc, not necessarily a full MSDN sub so he can download it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
If you don't want a full (and expensive!) MSDN subscription, then there will be online retailers who are authorised to sell VS2008 - Amazon, for example, can sell you a boxed copy of VS2005 at the moment, and I'd think the same will be true of VS2008.
"On one of my cards it said I had to find temperatures lower than -8. The numbers I uncovered were -6 and -7 so I thought I had won, and so did the woman in the shop. But when she scanned the card the machine said I hadn't.
"I phoned Camelot and they fobbed me off with some story that -6 is higher - not lower - than -8 but I'm not having it."
-Tina Farrell, a 23 year old thicky from Levenshulme, Manchester.
|
|
|
|
|
Hello everyone,
I am using WebBrowser Control and when I check all the supported properties, methods, and events associated with the WebBrowser and InternetExplorer objects; I don't see anything that can be used to catch the HTTP requests!
I am able to get the URL address for a website using DocumentComplete (Fires when a document is completely loaded and initialized) or get the Client Entered information such as username, password and so on using BeforeNavigate2 (Fires before navigation occurs in the given object.
My undrestanding is that for every object such as images a HTTP request is sent to the server. Then the question is how can I get/monitor all these requests?
Any information on this is greatly appriciated. Thank you and have a great day.
Khoramdin
|
|
|
|
|
Khoramdin wrote: My undrestanding is that for every object such as images a HTTP request is sent to the server. Then the question is how can I get/monitor all these requests?
Using the properties and methods exposed by the WebBrowser control - you don't. It doesn't fire these events on an object-by-object basis. They only work on a page-by-page basis.
If you want to capture all of this stuff, you'll need to build yourself a proxy server to capture it. All the request, object-by-object, will go through the proxy.
|
|
|
|
|
Hello david,
Thank you for your reply. I am also wroking on a HTTP Sniffer which and after I create a socket using the Socket class as following:
mySocket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);
After I receive the packets, I try to analyze it by first placing the packet in memory.
The packets are sorted based on thier ProtocalType into TCP, UDP and I am able to get information such as Version, HeaderLength, TotalLength, and so on for both the protocals.
My question is where should I look to get the URL address of the HTTP requests? If I am not mistaken the information should be available in HTTP Header rather than IP Header, TCP Header, or UDP Header!
Am I on the right track or I am way off and need to re-think this? Any information on this, is grealy appriciated Dave. As always, thank you so much for your help and have a wonderful day.
Khoramddin
|
|
|
|
|
Wow. You've gone from simply using a WebBrowser control to writing your own sniffer in one post.
Khoramdin wrote: My question is where should I look to get the URL address of the HTTP requests?
None of the headers will contain this. It'll be in the TCP packet data. You may have to string multiple packets together to get the entire request URL.
|
|
|
|
|
No, I started the work on BHO and then when I couldn't get the HTTP request moved to HTTP Sniffer. Then I heard from someone that I should be able to capture the HTTP requests using the BHO and that is why I thought to come and ask since when I looked for information about that, I could not find any. I wish I was that clever, mate!
The HTTP sniffer that I managed to put together is based on many articles that I found online such as http://www.c-sharpcorner.com/UploadFile/leonidmolochniy/SimpleSnifferInCS11222005232804PM/SimpleSnifferInCS.aspx[^]
Regarding what you said about URL address in TCP. If each packet doesn't hold all the information the how do they know where to start and where to end regarding the connection and file transformation?
Thank you,
Khoramdin
|
|
|
|
|
TCP is the transport protocol. It doesn't have anything to do with actually making the request. All it does is make sure that the "request message" makes it to the destination IP. If the message is too big for a single packet, the message is broken up into multiple packets until the entire message is sent. It's up to the receiving side to rebuild the message using all of the packets involved in it. TCP makes every attempt to get the entire message to the destination and get the packets reassembled in the correct order.
HTTP is the messaging protocol. This is what is making the requests and processing the returned data. It doesn't care that TCP is carrying the message. If you were so inclined, you could transport the request and response messages on SneakerNet and floppies if you built the correct drivers for it on each end of the connection.
Khoramdin wrote: how do they know where to start and where to end regarding the connection and file transformation?
By interpreting the data in each TCP packet. You have to have an in-depth knowledge of HTTP to do this.
|
|
|
|
|
Hi,
How can I read data from a COM port?
Best wishes
|
|
|
|
|
|
Do any of these articles help?
/ravi
|
|
|
|
|
I am having a problem with a timer in my program. I am sure I am missing serveral things that someone else will see easly.
this is a short example of my code.
private void button_click_1(object sender, eventargs e)<br />
{<br />
starttimer();<br />
Dothewhile();<br />
}<br />
<br />
public void starttimer()<br />
{<br />
timer1.start();<br />
timer1.interval = 1000;<br />
}<br />
private void timer1_Tick(object sender, EventArgs e)<br />
{<br />
MessageBox.Show("hello");<br />
}<br />
public void Dothewhile()<br />
{<br />
while (Run == true)<br />
{<br />
}<br />
}<br />
<br />
I am assuming the while statment is over taking the timer event and i just cant see when the timer hits but dont know for sure because i am stupid. But i would like to have some input on the ideal why the timer is never seen unless i turn the while statement off.
thanks danzar
Superman was my hero till he got a real job.
|
|
|
|
|
You are using a System.Windows.Forms timer, which ALWAYS runs on the main GUI thread. Therefore, your timer1_Tick method is waiting for the main thread to become available, which only happens when you exit the while loop. If you want to receive the Tick event in a separate thread (which you indicate is the desire from your post), then use either System.Timers.Timer or System.Threading.Timer, or start your method DoTheWhile in a new thread, which will free your main GUI thread for the timer.
Jeff
|
|
|
|
|
Perfect. thank you very much. this was exactly what i needed to know and a explaintion on why it wasnt working..
Thank you again!
|
|
|
|
|
danzar wrote: I am assuming the while statment is over taking the timer event
#1 Don't make assumptions.
#2 Don't make up terminology in text based communications ( over taking the timer ) because your readers won't know what you are talking about.
|
|
|
|
|
led mike wrote: danzar wrote:
I am assuming the while statment is over taking the timer event
#1 Don't make assumptions.
I know its a bad habbit I have. sorry
led mike wrote: #2 Don't make up terminology in text based communications ( over taking the timer ) because your readers won't know what you are talking about.
My poor choice of words, was from the lack of not knowing the correct terminolgy for the issuse I was having. I know now that I was wrong in my description of the issuse I was having. Sorry again for the mistake but was the result of learning.
A wise man said- You never learn unless you ask for help.
|
|
|
|
|
danzar wrote: I know its a bad habbit I have. sorry
No need to apologize to me. My suggestions are offered so you can improve your situation.
|
|
|
|
|
I thought that $ sign is supposed to indicate the end of a match. But I have seen patterns like (?<firstname>.*$) in some regular expressions samples. What could it mean in such a pattern?
Also I read in a book that the pattern (?<1>a)(?<1>\1b)* matches aababb with the capturing pattern (a)(ab)(abb).
Wasn't it better to use <2> for the second group? Why do we have two (?<1>) and why is there a back reference right after <1>? I mean \1.
Can someone please describe these regex samples? And please if this is not the right forum to ask this type of questions, let me know.
|
|
|
|
|
The dollar sign in your first example IS the last character in the pattern (it just happens to be in parenthases). The other use of $ is in replacement patterns. I'm not sure what happens if $ appears prior to the end of a regex pattern, but it either matches nothing, matches newline character, or matches $ character.
I don't have any info for you on the second pattern. The place I usually go to find Regex info is by navigating to "ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxfund/html/930653a6-95d2-4697-9d5a-52d11bb6fd4c.htm" in the Visual Studio Help->Search window.
Jeff
|
|
|
|
|
First off, this[^] page is a great reference.
As for you questions, the $ is described under the "Atomic Zero-Width Assertions" section as "Specifies that the match must occur at the end of the string, before \n at the end of the string, or at the end of the line". Whether it matches at the end of the string or before a newline is based on the RegexOptions[^]. MSDN decribes the Multiline option as "Changes the meaning of ^ and $ so they match at the beginning and end, respectively, of any line, and not just the beginning and end of the entire string.".
If you need to match a literal $ then you need to preceed it with a backslash (\) or include it in a character class (e.g. [$]).
Technically, (?.*$) is not valid. You may have meant (?:.*$), which is a non-capturing grouping construct (the (? ) part). See the "Grouping Constructs" from the link above. Basically, this tells the regex engine that you do not want to capture the characters matched by the .*$ part into a separate group. They will still be included in the overall match though.
For your second question, this is a form of recursion really. Hopefully, this break down will explain it:
(the | character indicates the current position of the regex engine)
1. |aababb
The (?<1>a) portion will match "a" from the input and save it in a group called "1".
2. a|ababb
The (?<1>\1b) portion is really (?<1>ab) at this point because group "1" has the value "a", so it will match "ab" from the input and overwrite the value in group "1" with "ab".
3. aab|abb
Since the (?<1>\1b) has the *, which means zero or more matches, then we perform this portion again. The (?<1>\1b) portion is really (?<1>abb) at this point because group "1" has the value "ab", so it will match "abb" from the input and overwrite the value in group "1" with "abb".
4. aababb|
We are at the end of our string so we are done. Now the full string matched would be "aababb". The value of the group "1" would be "abb", eventhough it previously held the values "a" and "ab".
If we had used <2> in the second construct, then step 1 would work the same, but step 2 and beyond would work like this:
2 (alt). a|ababb
The (?<2>\1b) portion is really (?<2>ab) at this point because group "1" has the value "a", so it will match "ab" from the input and save the value in a group called "2".
3 (alt). aab|abb
Since the (?<2>\1b) has the *, which means zero or more matches, then we perform this portion again. The (?<2>\1b) portion is really (?<2>ab) at this point because group "1" has the value "a", so it will match "ab" from the input and overwrite the value in group "2" with "ab".
4 (alt). aabab|b
At this point we can't match any more characters so we are done. Now the full string matched would be "aabab" (one less char than above). The value of the group "1" would be "a" and the value of the group "2" would be "ab".
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Wow, this is one of the most helpful responses I have ever seen. You are definitely getting a 5 for this one.
Jeff
|
|
|
|
|
Thanks! I've always loved regex's
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Thank you TJoe. It was a great answer to my question. Completely understood now. You are the man!
|
|
|
|
|
the problem is in form load event i kept the filling of the combobox named Gender from SQL tables
it is giving error in the following line
this.cGender.valuemember = "GenID";
(the value not found blah blah)
why it is doing so
sas
|
|
|
|