|
As I previously explained, you need to pass a reference to your ListView control to your class. Change the declaration of your constructor to:
public LoadLooms(ListView lvTopLooms)
and pass a reference to your control from the code in your form that instantiates LoadLooms .
Your code looks a bit odd though. I'm don't think it's good practice to pass references to controls around to other classes. It would probably be better if your class simply provided a method to retrieve data from your database. Your form class could then call this method to get the data to populate the ListView control and you would'nt have to pass a reference to this control anywhere. Also, you're doing stuff in the class constructor that would be better suited to being placed in a method. The class constructor should really only be used for the initialization of variables, resources etc.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thanks Paul,
I think I see how it works also thanks for the other tips
Kenwen
|
|
|
|
|
when it release ?
(not the beta or the expres)
|
|
|
|
|
I currently sell the beta and express versions for a astronomicalreasonable fee. The full versions are available from Microsoft.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Right now, only for MSDN subscribers to download, I thought.
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 )
|
|
|
|
|
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
|
|
|
|