|
I want to display the selected item when i clicked in the list view control and how to get the corresponding column item.
Udhay
|
|
|
|
|
listviewitem_click event code
dim strshow=listviewitem.selecteditem(0).subitem(colname).text
|
|
|
|
|
This will getting the item of the first index.
The user will be selecting randomly
|
|
|
|
|
Can someone please help me to my previous question.
|
|
|
|
|
Please don't do this. It not only makes the forums more noisy, but is also rude.
Cheers,
विक्रम
Be yourself, no matter what they say.
- Sting, Englishman in New York.
|
|
|
|
|
|
how to connect to telnet and execute the commands using c#.net
Please help me on this
Praveenkumar Palla
|
|
|
|
|
use TcpClient class.
to connect use its constructor TcpClient(String hostname, int Port)
to write a command:
byte[] buf = System.Text.ASCIIEncoding.ASCII.GetBytes(command.Replace("\0xFF","\0xFF\0xFF"));
TcpClient.GetStream().Write(buf, 0, buf.Length);
to read:
byte[] bytes = new byte[tcpClient.ReceiveBufferSize];
TcpClient.GetStream().Read(bytes, 0, (int)tcpClient.ReceiveBufferSize);
String s = Encoding.ASCII.GetString(bytes);
Choose encoding which you need
in read and write instead of TcpClient use your TcpClient instance name
Pawel
|
|
|
|
|
Thanks for the reply Pawel
But One issue,
First I connected to remote system(using IP,port) using TcpClient constructor.
then I red command (why because when I connected to that system it is prompting for the login and then password)
It returns the string
"????????\0??\0Microsoft (R) Windows (TM) Version 5.00 (Build 2195)\r\nWelcome to Microsoft Telnet Service \r\nTelnet Server Build 5.00.99206.1\n\rlogin: \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
then I wrote a command
string command="administrator";////////"administrator" that system login name
byte[] buf = System.Text.ASCIIEncoding.ASCII.GetBytes(command.Replace("\0xFF","\0xFF\0xFF"));
TcpClient.GetStream().Write(buf, 0, buf.Length);
Again I red command(actually it should return "Password:" )
but it returns
"administrator?\0Microsoft (R) Windows (TM) Version 5.00 (Build 2195)\r\nWelcome to Microsoft Telnet Service \r\nTelnet Server Build 5.00.99206.1\n\rlogin: \0\0\0\0\0\0\0\0\0\0\0\0\0\0\"
So not connected.....Please help me on this
Actually my application needs backend execution of commands at cmd.exe of remote systems (using IP) and should return command result.
Please help me on this
|
|
|
|
|
Hi there, I want to know how to insert a row into excel I created a file and in my form I am loading that file and putting values into it but when I load my dataset into it, it goes over some records. I just want to know how to insert a row. Thank you
|
|
|
|
|
How are you writing data to your spreadsheet?
Paul
|
|
|
|
|
sorry what do you mean?I am using the microsoft directive
using System;
using Microsoft......
|
|
|
|
|
You want to insert a row into an Excel spreadsheet. Could you post your code and be more specific about what the problem is?
Also, please don't post the same question twice in the forum. It is considered rude and won't help you get your question answered any quicker.
Paul
|
|
|
|
|
If you're referring to using Microsoft.Office.Interop.Excel; then you can give this a try:
Range cell1 = (Range)worksheet.Cells[rowNumber, 1];
int lastUsedCol = worksheet.Cells.SpecialCells(XlCellType.xlCellTypeLastCell, Type.Missing).Column;
Range cell2 = (Range)worksheet.Cells[rowNumber, lastUsedCol];
Range entireRow = worksheet.get_Range(cell1, cell2);
entireRow.Insert(XlInsertShiftDirection.xlShiftDown, System.Reflection.Missing.Value);
|
|
|
|
|
Hi,
I have some RichText control and i want to cancel the option of 'Select' ( i mean i want to cancel any option of selection text by the user ).
How do i do it ?
Thanks.
|
|
|
|
|
I believe you can achieve it by manipulating SelectedText, SelectionStart and SelectionLength properties of richtextbox control. You might not need all three properties.
|
|
|
|
|
RichTextBox.SelectionStart = RichTextBox.Text.Length;
RichTextBox.SelectionLength = 0;
Pawel
|
|
|
|
|
This is good solution - but it also disable my richText color that i change of some of the string in my text.
|
|
|
|
|
i think that i misunderstood your question.
do you want to not allow user to use his mouse to select some of the text in rich text box by his own? for example by mouse?
if so, i'd do that like this:
hold information about last selection made by you and a bool which states if you want to select something new now.
RichTextBox has an event: SelectionChanged. In this event if your bool is true do nothing, if the bool is false use code given by me in previous asnwer.
if it doesn't resolve your problem try to state it more accurately.
|
|
|
|
|
Hi,
I have a form that does a lot of processing, some using background threads.
What I want to do is "disable" any user actions until the processing is finished BUT still have the prgressbar continue if the user does try to click on the form somewhere.
I have tried the lock method but this freezes the progressbar if a user clicks somewhere. I've also tried disabling the main form but that doesn't disable individual controls on that form, especially tab pages.
I don't want to completly rewrite my program using all background threads.
How can I disable any user interaction?
TIA for any suggestions.
Glen Harvy
|
|
|
|
|
this.UseWaitCursor=true; can help you
|
|
|
|
|
Unfortuately that doesn't stop the user from clicking on a control on the form causing the status bar to freeze.
Glen Harvy
|
|
|
|
|
The normal way to solve this would be to open a modal dialog that holds the progress bar
and a Cancel Button.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
When opening the modal dialog how do I allow the mainForm to continue processing?
I have always thought that the normal way of doing it was to create a backgroundworker, have it do the processing and update a progress bar on the main form.
Glen Harvy
|
|
|
|
|
Hi Glen,
Disabling a form can be handled in several ways: you can disable all the Controls
(not recommended), hide the form, or make sure it can't get focus (that is exactly what
you get with a modal dialog).
There are many ways to get the work done; using a Thread, a ThreadPool thread, or a
BackgroundWorker are amongst them. And that is independent of your form situation;
the thread or whatever simply runs in the background; it gets organized by either the
form or the modal dialog, your choice.
Hope this helps.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|