|
I figured it out, you use the TcpListener, and the TcpClient.
|
|
|
|
|
I want to open a new form in a Windows Application in C# in its own thread. The form has a constructor that takes some parameters (always). The form updates a Flexgrid upon events fired from a live datafeed. The updates can happen quite often and I may have multiple forms open at once with multiple updates happening at once. I have tried to start a new thread, but does not appear to keep the whole form in a new thread.
Any suggestions would be appreciated.
Thanks
|
|
|
|
|
How are you opening the form in the thread? What exactly do you mean by
wdahl99 wrote:
but does not appear to keep the whole form in a new thread.?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
How can you capture the logon and log off event in windows xp.
I am creating a windows service that needs to do something when a user logs on to their account in xp and logs off from their account. It would be good if I can capture their Username as well so I know who is logging on and off.
|
|
|
|
|
|
Thanks
This is good to find out which user is currently logged on. But how can I fire off and event when they log on and off.
|
|
|
|
|
I'm trying to take a numeric value from a textBox and compare it against another numeric value that is supplied by the app, but i'm stuk trying to convert the string value of the textBox1.Text to int value for the if statement, i keep recieveing the following errors:
Cannot implicitly convert type 'string' to 'bool'
Cannot implicitly convert type 'int' to 'string'
here is the code:
private void button1_Click(object sender, System.EventArgs e)
{
string myID;
TextBox txtbx = new TextBox();
txtbx.Text = myID;
if (myID = 123)
MessageBox.Show("You are right");
}
I've tried changing the string myID to int myID but it hasn't proven any better, as i get the same errors listed above with int to bool, and int to string as the only difference.
also i'm getting a slightly less important error of:
Use of unassigned local variable 'myID' which i understand means i haven't initiated the variable, but its failing inside the if statement.
I'm still learning so if you guys could help it would be great.
thanks
newbie
|
|
|
|
|
Anonymous wrote:
if (myID = 123)
You are assigning myID with the value of 123 in this if statement. Are you sure this is what you want?
If you want to compare with 123, then it should be
if(myID == "123")
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
Weiye Chen wrote:
You are assigning myID with the value of 123 in this if statement. Are you sure this is what you want?
well the truth of the matter is that in the end the desired result will be to pull the data from either a db or assign a solid value at a later date, right now i was just trying to get the unit to run.
thanks for the quotes..... that worked.
any ideas on the "Use of unassigned local variable 'myID'" ?
newbie-
|
|
|
|
|
Anonymous wrote:
"Use of unassigned local variable 'myID'"
This is because you had declare the variable myID and used it without assigning any value to it such as this
txtbx.Text = myID; Since myID has not been assigned any value, txtbx.Text would therefore have an unknown value/type which can be dangerous.
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
If you want to compare a string with a number you should convert the string at first.See the following code :
if(intValue == int.Parse(textBoxText))
{...}
[ _ Always there is another way _ ]
|
|
|
|
|
A friend had wrote that you can use the if statement as if (txtbx=="123")... this is axactly true and there is anoher way to convert your variable MyID. you can do it like this:
Convert.ToInt32(txtbx.Text)...
but there is and issue here, at the beginning you must define your variable as integer. if you define a string variable and then if you try to assign it to integer variable you will have the similar problems.
Good Luch on your work. i hope you will be succesfull...
sayinsinan
|
|
|
|
|
I would like to figure out the best way to add a DatePicker to a webform. I am currently just have a button on the webform. When the button is pressed, I would like the Calendar to popup. I also have the calendar inside of a div. I am not quite sure how to make the calendar show up when the button is clicked.
Eric
|
|
|
|
|
There are a number of solutions to this problem on the web already.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Can someone please tell me how to add a scroll bar to a panel in C#, tried everything but the scroll bar never appears on the panel regardless of whether a control is out of its view or not. Any help would be appreciated
|
|
|
|
|
Try setting the panel's AutoScroll property to true . I hope this helps.
John 3:16: "For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life."
|
|
|
|
|
I've just been working on a custom multiple select tree control (the ones here at TCP did not satisfy the requirements) and I'm running into a problem. I maintain a hash table of selected nodes and everything is hunky-dory until I start deleting nodes from the underlying TreeView "Nodes" TreeNodeCollection. A client could knock a selected node (node in the selection table) out of that collection and I'd have no way to tell my class to remove the node from the selection table.
Is there some event to listen in on for this? I could write some methods in my custom TreeView class like 'remove node' or something, and make a big note in the comments that future clients need to use that... but that's not good enough for me.
Any suggestions??
|
|
|
|
|
hi!
i want to send a POST HTTP Request to a Web Server!
Here i got some information:
http://msdn2.microsoft.com/library/debx8sh9(en-us,vs.80).aspx[^]
my problem is: how can i send such a POST Request, with the JSESSIONID from the GET Response before and the POST Data!?
<br />
POST /webkeeper/Controller HTTP/1.1<br />
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-gsarcade-launch, *
-> the username and password i dont want to show here, thats the reason for the letters: *****
the JSESSIONID i got from a GET HTTP Response:
<br />
HttpWebRequest request1 = (HttpWebRequest)WebRequest.Create("https://www.myzone.at/webkeeper/Controller");<br />
request1.CookieContainer = new CookieContainer();<br />
<br />
HttpWebResponse response1 = (HttpWebResponse) request1.GetResponse();<br />
response1.Cookies = request1.CookieContainer.GetCookies(request1.RequestUri);<br />
<br />
Console.WriteLine ("HTTP/" + response1.ProtocolVersion + " " + response1.StatusDescription);<br />
Console.WriteLine (response1.Headers.ToString());<br />
<br />
String sessionid = "Set-Cookie: ";<br />
sessionid += response1.Cookies[0].ToString();<br />
cu+thx
|
|
|
|
|
You have a complete example on the page you linked to. What is missing?
---
b { font-weight: normal; }
|
|
|
|
|
i, now it works
but...when i want to use managed c++ then i need a c++ compiler oder a c# compiler? can i compile it with dev-cpp and g++?
cu
|
|
|
|
|
Can someone tell me how a cell within a datagrid can be created or modified to span more then one column, like HTML's 'colSpan' ("Column Span")?
Here's what I'm trying to do:
Column Header 1 | Column Header 2
---------------------------------
Data 1 goes here | Data 2 goes here
---------------------------------
Data 3 goes in this wide cell
---------------------------------
Thanx.
|
|
|
|
|
|
I have a small quiz-like thing, with 30 Q's but you only do 10 each time you take the quiz.
So to get random Q's im using Random() and switch().
But you dont want the same Q twice, so i could create a value for every question that changes when the Q is asked, but thats a bit of a pain.
Is there any easyer way to check whether a Q has been asked?
|
|
|
|
|
You could do random shuffle with questions, and then use them seqentionaly. This way, you'll get random order and won't ask same question twice.
David
|
|
|
|
|
btw you should write "easier"
David
|
|
|
|