I forgot to delete it. Apologizes for that.
manustone
Posts
-
casting from System._ComObject -
casting from System._ComObjectHi All I have just a basic doubt regarding using objects of type
System._ComObject
. Once I know the underlying type, in oder to retrieve the right type of class, is it always correct to use the as keyword like this?// myComObject variable is of type System._ComObject
MyConcreteClassType o = myComObject as MyConcreteClassType;
if ( o != null )
{
// you can use MyConcreteClassTyp methods
} -
what to do after a read from a socket Timeouthi Freakyit thank you very much for this snippet..I didn't know about it Mmstn
-
what to do after a read from a socket TimeoutThank you very mcuh! I didn't know that! It helps! mnstn
-
what to do after a read from a socket TimeoutHi All I am using
TcpClient
to read from a socket and I set the propertyReceiveTimeout
to a value let's say 3 seconds. As per documentation, after the read fails because of a Timeout, anIOexception
is thrown. After that point, each time I callReadLine
the exception is systematically thrown again and again. What to do to reset the Timeout value or to renable the reading from a socket with no worry? I reset a new value forReceiveTimeout
but it doesn't work. Do you know what to do? -
getting the local port as netstat in C# + small doubt on network connectionThanks! I am testing this right now..I have a small doubt bit trivial. I use embed the NetworkStream in a StreamReader like this
NetworkStream aStream = _client.GetStream();
StreamReader reader = new StreamReader(aStream);calling
reader.Close()
does it safely close also theNetworkStream
underlying or do I have to keep a reference to the NetworkStream and close it explicitly? -
getting the local port as netstat in C# + small doubt on network connectionHi All This post got actually 2 questions but related each other. I hope you can help me even just solving one of the 2. In Windows I usually call NETSTAT to have information regarding the status of my network connections. I am interested in getting the data below produced by Netstat using C#. *Local Address *The state of the connection. Active Connections Proto Local Address Foreign Address State TCP ITA-2317A:3377 server1.mylan.co.uk:50506 FIN_WAIT_2 TCP ITA-2317A:3378 server1.mylan.co.uk:50507 FIN_WAIT_2 I am interested in catching the FIN_WAIT_2 state that sometimes is causing me some problems. My C# application sometimes leaves the network connection in this state..do you know some possible workaround? I am using TcpClient class and I use Close() method..after I do this what check can I do to make sure that my connection is not in the FIN_WAIT_2 state?
-
Event for the release of a menu itemYes and it doesn't work. I solved doing the screenshot 50 ms after the click.
-
Event for the release of a menu itemThanks! Simple solution that works nice. It is true..i was not able to find such event AFG
-
Event for the release of a menu itemHi All I did a function for doing a screenshot of the WinForm application I am doing now. This function is run when the user click on a item of the main menu of the form ( MenuStrip ). The point is that in doing this way the screenshot foo is called with the menu still open so the image includes also the open menu; because of this I need to call the function right after the menu item gets close. Do you know what could be the event? I tried Drop DropDownClosed but it doesn't work. Do you know what event fit my issue? Thank you very much. Regards Mn
-
splitting a long stringHi Thanks! Is there any other way without the + char at the end? For each + I think that C# due to how the String are will create in memory a new object that is the result of "String1" + "String2". I need just some facility so that compiler will recognize that it must print on the same line. This was the purpose of my questions even if I didn't make it explicit
-
splitting a long stringThanks, but I need the string on the same line not on different lines. When I have to print that I will see the new line I guess.
-
splitting a long stringHi All Do you know if it is possible to split a string in several lines in C# In C++ I can write
std::cout << "this is a very "
"very very very "
"very very very "
"long string split into 4 lines that will be printed in one";Do you know if I can do the same in C#? Thanks MN
-
behavior of Windows.Forms.Timer vs WM_TIMERHi Rob! Thanks for your reply! So at the end regular updates cannot be guaranteed using WM_TIMER. What if I use 30 System.**Threading.**Timers for that purpose? Do C# create a thread for each System.Threading.Timers or not? If it does than probably it is better a ThreadPool.. what are your thoughts?
-
behavior of Windows.Forms.Timer vs WM_TIMERThanks for your response!
-
behavior of Windows.Forms.Timer vs WM_TIMERHi All I have a small doubt regarding a Forms.Timer and WM_TIMER. If I remember right each System.Windows.Timer.Forms triggers an event ( bounded to the Tick event ) for each WM_TIMER message coming from the message pump of the Form where is included. Since each of this WM_TIMER messages comes from the main message queue of Window OS, if I Have 30 forms on my screen, each with its own Forms.Timer object updating some graphic component of the form (label text, or other ), can I say that each form will be strictly updated one after one? I don't know how WM_TIMER is dispatched and processed in each form given that the queue of the OS is unique and shared by all the forms. Regards Manustone
-
getting a specific tag out of a web page Dom info [modified]I switched to csEXWB and everything was good. Still I don't understand why using WebBrowser control it doesn' work. Anyway for all interested please read this page The most complete C# Webbrowser wrapper control[^]
-
getting a specific tag out of a web page Dom info [modified]Hi All I am creating an application in order to get the DOM info of a Web Page. I cannot extract a TBODY tag using my application. I am using *the control WebBrowser shipped by Visual Studio *a reference to the Com Microsoft.mshtml 7.0.3300.0 If I use the "Internet Explorer Developer Toolbar" I can see all information I need. The <TBODY> tag has id "tbody_rank_by_level" and carries a list of <TR> tags full of data that are showed in attributes innertHTML and innertText. Using the code below innertHtml and innertText are both null. What I am doing wrong?
mshtml.IHTMLDocument3 domDoc = this.webBrowser.Document.DomDocument as mshtml.IHTMLDocument3;
mshtml.IHTMLElement element = domDoc.getElementById("tbody_rank_by_level");
String innerHtml = element.innerHTML;
String innerText = element.innerText;modified on Monday, January 11, 2010 3:07 PM
-
saving a rendered web pageWell I have just found what I need for my specific purposes; I hope that it fits also yours. Please have a look at this project The most complete C# Webbrowser wrapper control[^] Digging and trying I found that this project provides DOM information and is exactly what I need. I found that you need an active x for accomplish this handling the IHTMLDocument2 class. PLease look also here column_1[^] and here column_2[^]
-
saving a rendered web pageProbably I found what I need to do. I have to download something called DOM information. For my purpose it would be enough. Do you know how to do that in C# after a web page was loaded?