|
Hello
If your telnet is a console, I don't know if this would work or not but you may give it a try!! Even consoles in WinXP are considered windows to some extent!! Than means that the window in which the console is displayed on is still a window and still has a handle. Try sending it messages with key strokes using Windows API SendMessage() function.
Regards
|
|
|
|
|
|
What do you mean by automation?
Implementing the Telnet protocol with the server shall do this easily and you can find tons of example on this
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
sorry for the ignorance, but how do I implement telnet protocol ? (or can you at least direct me to an example).
Its the first time I'm trying to implement a protocol
|
|
|
|
|
No Problemo Buddy. I am in India and it 2 AM here. Gotta catch some sleep )
Would it do if i sent you an implementation done earlier? Would that help?
Send me your id and will mail it to you....
YAWN!!! Sleepy I am )
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
hey, it would be a great help if you would just give me an article or something. I will start looking for one again.
Thanks again!
|
|
|
|
|
Hey, I got it myself!
Thanks anyway!!!
|
|
|
|
|
Well I am talking about a full fledged telnet client, that I had to code for one of my projects, to enable citrix console guys to hook in as per the policy defined. Anyways, good that you found soemthing. Many fo the samples out there, but then they have some potential loose ends as far as i have seen.
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
hello,
Can anyone help me in creating an equivalent vb.net argument type property development in c#. I have one code tell me how to implement the same thing in c#
Public ReadOnly Property GetValues(ByVal index As Integer) As DataRow
Get
GetValues = m_RecordTypeDS.Tables(0).Rows(index)
End Get
End Property
|
|
|
|
|
Hello
The property you are talking about -If I got you right!!- is called indexer in C#. You use it like this
MyReturnValue = MyObject.MyProperty[Sometype];
MyObject.MyProperty[Sometype] = SomeValue;
To make an indexer like the property you posted you simply write this syntax
public DataRow this[int Index]
{
get
{
return m_RecordTypeDS.Tables[0].Rows[index];
}
set
{
m_RecordTypeDS.Tables[0].Rows[index] = value;
}
}
Regards
|
|
|
|
|
hi guys, is there any way to move from one line of code to another in C#, something like GOTO in some previous languages ?
Mr.K
|
|
|
|
|
Hello
Sure!! There are still gotos and labels in C#
private void SomeThing()
{
goto MyLabel;
MyLabel:
}
Regards
|
|
|
|
|
this is the way
<br />
private void button1_Click(object sender, EventArgs e)<br />
{<br />
int i;<br />
for (i = 0; i < 10; i++)<br />
{<br />
if (i == 5)<br />
goto skip;<br />
}<br />
skip:<br />
MessageBox.Show("i = " + i);<br />
}<br />
<br />
but this is not so robust
try this
<br />
private void button2_Click(object sender, EventArgs e)<br />
{<br />
int i;<br />
i = skip();
MessageBox.Show("i = " + i);<br />
}<br />
<br />
private int skip()<br />
{<br />
for (int i = 0; i < 10; i++)<br />
{<br />
if (i == 5)<br />
return i;<br />
}<br />
return 0;<br />
}<br />
|
|
|
|
|
I am developing a windows application in which I am calling a dialog window in a thread. When I minimize the Dialog, it not only minimize but also closes. Why it is showing this kind of behaviour?
The code i used is:
On Form1:
private void button1_Click(object sender, System.EventArgs e)
{
Thread td = new Thread(new ThreadStart(initiateForm2));
td.Start();
}
private void initiateForm2()
{
Demo frm2 = new Demo();
this.Hide();
frm2.ShowDialog();
}
On Form2:
private void btnMinimize_Click(object sender, System.EventArgs e)
{
this.Hide();
}
The problem is that when I hide the second form, it also call the Closing event of the Dialog form. It closes the dialog window. Why it is so?
Thanks,
Sandeep S. Sekhon
|
|
|
|
|
I guess this behaviour is caused by the fact that you show the second form as modal dialog. Use the Form.Show method to display the second form. Furthermore you should no longer need to do this inside an extra thread, so the whole thing cuts down to:
private void button1_Click(object sender, System.EventArgs e)
{
Demo frm2 = new Demo();
this.Hide();
frm2.Show();
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
hello
i want to make report in my WinApp
i want to dispaly just One record at each page
plzzzzzzzzzzzzzzzzzzzzzzzzz
i want help give me an example to do that ...
Palestine
|
|
|
|
|
What kinf of reports are you talking about?
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I have a datagrid view that has a number of cells that are readonly.
The default behavior of tabbing in a datagridview is to go to the next cell. What I'm looking to do is make it so that it skips readonly=true cells and goes to the next cell.
Here's my problem. No element(that I can find) within the datagridview has a tabstop property, so I need to handle the keypress event.
The problem I have is, I can't seem to catch it. I've tried handling datagridview.keypress, and even handling the EditingControlShowing event to assign a handler to the textboxes that make up the dgv to handle the tab.
So here's my question, has anyone done this themselves, or has any idea how to skip cells that are readonly in a datagridview?
|
|
|
|
|
Hello
If you have .Nt 2.0 you can handle PreviewKeyDown event which can catch the tab key, or handle the CellEnter event and shift the focus to the nearest non-readonly cell.
Regards
|
|
|
|
|
Hi,
How can i create and write to an xml file with C# the date and time in seperate tags to an xml file like this:
<root>
<date>ddMMyyyy<date>
<time>HH:mm:ss<time>
<root>
Thanks in advance!
|
|
|
|
|
Hello
In System.Xml namespace there are two classes: XmlReader and XmlWriter .
Use them to make the xml file and write the data to it.
Regards
|
|
|
|
|
Use the ToString method of the DateTime class to create the string representation of the date and the time.
As you have used the exact format that the ToString method uses, it's easy:
daDate.ToString("ddMMyyyy")
and
daDate.ToString("HH:mm:ss")
---
b { font-weight: normal; }
|
|
|
|
|
Using daDate.ToString("HH:mm:ss") is a risky choice as ":" is a placeholder for the time separator. Hence for example Italian regional settings would give something like "21.17.48" instead of "21:17:48". Even in a fixed region users could simply break the format by changing their regional settings. Always provide a IFormatProvider, typically CultureInfo.InvarientCulture. If you create your own CultureInfo instance to do the formatting, remember specifying "false" to disallow custom overrides.
I assume this is a fixed XML format that MUST be followed? If it is I guess you do not have a choice, but if it is in ANY way possible to influence the format do so, as it is basically as wrong as it can be.
When storing dates as strings there are two formats you can use: "yyyy-MM-dd" or wrong. "ddMMyyyy" clearly belongs in the "wrong" category as it is ambigious and it doesn't even sort correctly. When storing date and time, preferably write them into a single entry with the ISO format.
If you use the XmlSerializer, just serialize/deserialize a DateTime object and it will use the correct ISO format.
|
|
|
|
|
lmoelleb wrote: Using daDate.ToString("HH:mm:ss") is a risky choice as ":" is a placeholder for the time separator.
Yes, you are right. I didn't think of that.
The character should be quoted to be interpreted as a literal:
"HH':'mm':'ss"
As the format now contains no culture variant components, it's not affected by any cultural differences.
Using a format provider doesn't affect the output in this case, it's only encouraged for programming style. If no format provider is specified, the CultureInfo.CurrentCulture is used, as there exists no formatting without a format provider.
---
b { font-weight: normal; }
|
|
|
|
|
I assume that you already know how to write an XML output.
So to segregate the Dat and time, you can use the DateTime class to get the date and time seperate portions from the DateTime.Now
Just take out the time and date component from the supported methods
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|