|
When you say "is not work" what does happen?
Does the code reach the Recieved method at all?
If you put a breakpoint at "if(timerSend...", does the code reach it?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Hi,
"is not work" doesn't tell us anything, we need hard facts in order to provide specific help.
Lacking that, one can only provide general advice, such as:
- learn how to debug
- improve the observability of your code, i.e. make visible what is going on. You can insert extra statements for that purpose, such as Console.WriteLine("I am here"); when running inside Visual Studio; or MessageBox.Show which I don't like because you only see one at a time, and don't get a historic summary.
Things to look for:
- is Received running at all?
- what is the value of byteRead?
- what is the value of sReply?
- what is the value of sProtocol?
Did you notice I covered your code top-down? The goal is to see which parts work fine, and what is the first statement that doesn't perform as you expect.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
public delegate void DisplayActionHandler();
public void StartTimer()
{
if (this.InvokeRequired)
{
// Invokes the timer restart from the timer thread.
this.Invoke(new DisplayActionHandler(StartTimer));
}
else
{
this.timer.Start();
}
}
public void StopTimer()
{
if (this.InvokeRequired)
{
// Invokes the timer restart from the timer thread.
this.Invoke(new DisplayActionHandler(StopTimer));
}
else
{
this.timer.Stop();
}
}
Use StopTimer() and StartTimer() instead of myTimer.Stop (or myTimer.Enabled = false).
If your timer was called from the other thread that the caller, the simple Stop/Start will not work, you will need to Invoke your stop/start from the thread in that the timer was created.
Thank Sergiu Dudnic
|
|
|
|
|
how can i enumerate all groups members in all groups on a member server
|
|
|
|
|
Hy guys!
I have a question about text size in WebBrowser control in MS Visual C# 2005 Express Edition. You know when you view web pages in a browser you can alter the overal text size from the contex menu. For example when I open MSDN help in C#, from the context menu i can choose the text size. I actually found out that this operation afects also my webbrowser control. So if i choose "Larger" text size when i am viewing MSDN, my webbrowser control will also change it's text size.
My question is: How can I control the text size in my webbrowser control? Is there a property or some way to do it?
Thank you for your time.
Cheers!
|
|
|
|
|
Just a thought,
I know you access to the DOM so you might be able to do this if you set the style on the body of the doument.
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
I did a little looking for you and you can call WebBrowser.Document.InvokeScript to execute some script on the document.
So you could do something like this
webBrowser1.Document.InvokeScript("body.style.style.fontSize = '10pt';");
I'm not sure if you can directly execute javascript like that you might have to use a function.
You could always add your function to a page by appending the script to WebBrowser.Document.InnerHTML
InvokeScript(string) - MSDN[^]
OR if you want to create a function in your page to do the sizing and pass it parameters
InvokeScript(string, object)[^]
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
Thank you, this was helpfull!
Cheers!
|
|
|
|
|
Yes, the WebBrowser Control uses the settings you defined while using Internet Explorer. It also shares a lot of code with IE.
For your own web pages, you can set all style attributes within your pages themselves, using either HTML, XHTML or better yet CSS.
For exisiting pages, I don't know if and how you can programmatically alter the IE settings (and I would not like an app that modifies how IE works without me asking it to do so). Well, actually I don't use IE that much, there are even better browsers around
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi,
In the list view i've couple of temporary items and they are staying at the bottom of the list, when i do sorting i dont want to include those two rows how to do that?
Thanks
|
|
|
|
|
Only way I know is to remove them, sort the list and then add them again, unless you inherit from the list view and provide your own custom enumeration.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
BalajiRamasamy wrote: Adding items at bottom in List View
Hi there,
Try this, maybe you could like use it on a Button click event or something...:
int i = listView1.Items.Count;
listView1.Items.Add("NEW-ITEM", i++);
--------
First, we define an Integer (i) and assign it the value of the total amount of items in the listView1 control, then we add an item at the bottom of the list by incrementing the total item amount by 1.
Hope this helps
regards,
jase
|
|
|
|
|
I did exactly the same, but after sorting what ever i add it automatically gets sorted and placed at the top, it is not listening me
|
|
|
|
|
Something like this:
this.listView1.Clear();
this.listView1.Items.Add("Item 2");
this.listView1.Items.Add("Item 1");
this.listView1.Sorting = SortOrder.Ascending;
this.listView1.Sort();
this.listView1.Sorting = SortOrder.None;
this.listView1.Items.Add("Temp1");
this.listView1.Items.Add("Temp2");
|
|
|
|
|
I could not find the ip address of my internet server.
i used the code to find the server ip but it only fetch my local LAN ip address.
i want to know the IP that given by my ISP through C# Windows Application code.
or
And i use web browser control, how to find the IP address of the URL.
Because by using PHP i get the IP using RemoteObject with the browser URL.
how i got that same by using that control in C# Windows Application.
by Vasanth.A
|
|
|
|
|
Hi,
The solution requires the help from a web server. This[^] should help you out.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
thank you,
but i want to find through C# code
give me exameple
|
|
|
|
|
In order to get the out-side-world IP address, you have to talk to the outside world as it is shared between the various users on the LAN. Google for "whats my IP" and you will get lots of hits about it.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
You can get the ip address(es) from an host name with the following code:
System.Net.Dns.GetHostEntry(hostname).AddressList;
This method will retrieve all the ip addresses corresponding to a given host, documentation here.
For example, if hostname is "www.google.com" you will get:
{System.Net.IPAddress[6]}
[0]: {74.125.39.105}
[1]: {74.125.39.106}
[2]: {74.125.39.103}
[3]: {74.125.39.104}
[4]: {74.125.39.99}
[5]: {74.125.39.147}
|
|
|
|
|
Except that if you use it on yourself, you will get your LAN address.
|
|
|
|
|
Well, if he passes the external dns address of the server, I think he will get the external ip address, or am I wrong?
|
|
|
|
|
Only if he can get the external dns address in the first place, which might not even exist
Btw, I didn't 1-vote you, it didn't seem that bad - just "not exactly what he asked for", his question sortof half implies that it's all a local thing
|
|
|
|
|
No problem, I was not arguing with you, only clarifying what I had in mind while answering to the OP.
I was more concentrated on his second question (getting the IP address from the browser url) that might imply he knows the external address.
|
|
|
|
|
Hm yea, you got a point
Well he's not saying anything yet, but I guess we'll find out
|
|
|
|
|
Hi, normally I wouldn't recommend it, but please check my article - it gives you the information you need to get your public IP address with C# (and just C#) without cheats (not using external websites that may disappear at any moment)
The second thing, I don't know.
|
|
|
|