|
Hi,
My question is very simple. I'm working on ftp client. Its function is clear, just connecting to the ftp server, send a ftp command and receieve a response from the server. Both the result of sending commands and receiving the response are shownn in the richTextBox. What i aimed to do is to make the text color of the sending command is deffirnt from the received response (in richTextBox)
For example,
command: help ===> appearse in the richTextBox as help(in blue color)
response:
ABOR
ACCT
ALLO
APPE
CDUP
CWD
DELE
HELP
LIST
MDTM
MKD
MODE
NLST
NOOP
PASS
PASV
PORT
PWD
===> appearse in the richTextBox in Red color
I tried this code for coloring, but it is coloring the whole text in the richTextBox
the code is
private void sendBtn_Click(object sender, EventArgs e)
{
String[] array = new String[3];
array[0] = bodyTxt.Text;
array[1] = cmndTxt.Text;
bodyTxt.Text = "";
richTextBox.AppendText(array[1] + "\r\n");
// Coloring
richTextBox.SelectionStart = 0;
richTextBox.SelectionLength = cmndTxt.Text.Length;
richTextBox.ForeColor = Color.DarkRed;
writer.WriteLine(cmndTxt.Text);
writer.Flush();
ReadResponse(); //read response from the server
bodyTxt.AppendText(array[0] + "\r\n");
}
for clearification:- cmndTxt.Text is the command the i want to send to the ftp server.
richTextBox is the textBox that recieves the response-from the server-
and the command -from the user.
what should be the modifications for my code?.
Many thanks in advance
|
|
|
|
|
|
Dear Kishore,
Thanks for your post. However,
I had no experience on RTF. Understanding RTF should take much time from me. Also, I didn't found sufficient examples of RTF. All what i need is how to make different colors in one richTextBox. I know that :-
richTextBox.SelectionStart = x; //For starting selection a text in the richTextBox at point x
richTextBox.SelectionLength= y; // For defining the length of the selection
richTextBox.ForeColor = z; // For defining the Color of the text
the complete Coloring code for my project is shown in my 1st post.
Just I need to know what was my error in coding.
thx in advance
|
|
|
|
|
hello, i need a solution for getting only 50 files from a directory.
i have a timer, the elapsedtime time is set to less then a second.on every timer tick i need to get 50 files from directory.
something like this.
getfiles(@"C:/data");
but only 50 files at a time;
is there any way of doing it.
// why i need this
acttulay i created the thread for each file in a directory but the perfomance was horrible wehn the no of files was more thena 500. so i want to do it for every 50 files per timerclik.
hope to get better response.
|
|
|
|
|
hi
i have a asp.net website and i want to send mail from my site (in iis from my computer) to my mail(for example outlook),but how to configure my email seeting in my iis on my computer ?
if possible guide me for configure my outlook for receive and show mails.
thanks.
|
|
|
|
|
Control Panel>Performance and Maintainance>Administrative Tools>Internet Information Services>Default SMTP Virtual Server>Properties>Access>Relay:
All except the list bellow
this should grant the service even to those in your network.
Internet Information Services
Please vote for me
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi there,
I have to drag and drop [toolbar]toolstrip from my toolstrip container onto the form. How can this be made using coding in c# 2005.
|
|
|
|
|
Hi,
How or is it possible to declare a class inheritet from System.ComponentModel.Component as abstract and still be able to use the VS.designer??
/besinci
|
|
|
|
|
Abstract classes can't be instantiated. How do you think you would put an instance of your class in the designer?
Short answer: No.
Regards
|
|
|
|
|
The problem is..
-When inherited from the base class that is defined as abstract; The designer wants to call the default contructor of the base class (there is no problem using the inherited class in the designer).. but it can't as you also mentioned..
-My question was about some how to awoid the designer to call the deafult contructor of the base class..
Regards, /Besinci
|
|
|
|
|
If I understood you right, you want to inherit a class from Component, make it abstract, then inherit more from this class. Right?
Component => Base abstract class => Inherited class
ans when you put the inherited component in the designer, you are getting an error because of the abstract class.
Well, instead of making your class as abstract, you can declare the constructor as protected. This way your base class won't be instantiated, yet any inherited class can call that constructor in the designer.
I hope I got you right this time.
Regards
|
|
|
|
|
Hi,
I am using TreeView control in form application of VS2005.
I want that whenever i add node to a parent node, it should check that if the node is already existing in the parent then it will be replaced otherwise be added.
So how we do search for child nodes for a particular node(parent).
RootNode
Node1
Child1
Child2
If i am adding child2 to Node1 then it should replace the existing.
thanks
Gajesh
Pune(India)
|
|
|
|
|
How can i have a Styled ScrollBar For TextBox
for example How can i set scrollbar color or width ??
With Thanks
MHF
-- modified at 3:57 Tuesday 26th December, 2006
|
|
|
|
|
Hi All
I am created crystal Report By using Command SQl ( by selecting ADD Command on the Database Expert-> Create new connection -> Add Command
I have two problem
1) If I Eable the Logon Promt (i.e EnableDatabaseLogonPrompt ="true" )
then following promt is display Before the Report View and Asked for the server passward if i enter passward then Report is Display otherwise not ( It's Happen 1 st time when aplication is run) the promt is given below in bold letter
The report you requested requires further information.
___________________________________________________________________
SERVER
Server name: Server
Database name: ERPDB
User name: sa
Password: --------
Use Integrated Security
2) If I disable the Logon promt (i.e EnableDatabaseLogonPrompt ="false")
then following Error Message is Display and Report Can not Display
Logon failed. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: Login failed for user 'sa'. SQL State: 42000 Native Error: Error in File C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\SalaryReport {4244492D-0548-4110-AF32-9A9E5066CD0E}.rpt: Unable to connect: incorrect log on parameters.
My Actual problem to Display the Report Without Asking Server Passward to User Because User Don't Know the Server Passward
Please any one Help me
Thanks for Your Time
Anil Jagdale
|
|
|
|
|
Hi All
I am created crystal Report By using Command SQl ( by selecting ADD Command on the Database Expert-> Create new connection -> Add Command
I have two problem
1) If I Eable the Logon Promt (i.e EnableDatabaseLogonPrompt ="false" )
then following promt is display Before the Report View and Asked for the server passward if i enter passward then Report is Display otherwise not ( It's Happen 1 st time when aplication is run) the promt is given below in bold letter
The report you requested requires further information.
___________________________________________________________________
SERVER
Server name: Server
Database name: ERPDB
User name: sa
Password: --------
Use Integrated Security
2) If I disable the Logon promt (i.e EnableDatabaseLogonPrompt ="true")
then following Error Message is Display and Report Can not Display
Logon failed. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: Login failed for user 'sa'. SQL State: 42000 Native Error: Error in File C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\SalaryReport {4244492D-0548-4110-AF32-9A9E5066CD0E}.rpt: Unable to connect: incorrect log on parameters.
My Actual problem to Display the Report Without Asking Server Passward to User Because User Don't Know the Server Passward
Please any one Help me
Thanks for Your Time
Anil Jagdale
|
|
|
|
|
Hi All
I am created crystal Report By using Command SQl ( by selecting ADD Command on the Database Expert-> Create new connection -> Add Command
I have two problem
1) If I Eable the Logon Promt (i.e EnableDatabaseLogonPrompt ="true" )
then following promt is display Before the Report View and Asked for the server passward if i enter passward then Report is Display otherwise not ( It's Happen 1 st time when aplication is run) the promt is given below in bold letter
The report you requested requires further information.
___________________________________________________________________
SERVER
Server name: Server
Database name: ERPDB
User name: sa
Password: --------
Use Integrated Security
2) If I disable the Logon promt (i.e EnableDatabaseLogonPrompt ="true")
then following Error Message is Display and Report Can not Display
Logon failed. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: Login failed for user 'sa'. SQL State: 42000 Native Error: Error in File C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\SalaryReport {4244492D-0548-4110-AF32-9A9E5066CD0E}.rpt: Unable to connect: incorrect log on parameters.
My Actual problem to Display the Report Without Asking Server Passward to User Because User Don't Know the Server Passward
Please any one Help me
Thanks for Your Time
Anil Jagdale
|
|
|
|
|
Hello everyone,
How can I make the folder containing my file to open programmatically ?
When a user selects a file from my program and click "got to folder" in contextmenu the explorer will open the folder (not my application)..
Thanx for your helps and best regards..
.:: Something is Wrong ::.
|
|
|
|
|
Hello!
You can use the class Process for this:
Process.Start("explorer /e,"+Path.GetDirectoryName(myFileName));
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Thank u very much.. It works for me but still have a problem ... When the folder opens I want to make my file selected. Is this possible ?
Best Regards..
.:: Something is Wrong ::.
|
|
|
|
|
explorer /select,c:\myfile.txt
/ravi
|
|
|
|
|
I have merged two datasets using "Dataset.Merge" command, which the data is retrived from two different dBase-III databases of same structure.
Can I create a new database of using dataset, if yes, how...?
Regards,
Kishore.
|
|
|
|
|
KishoreT wrote: an I create a new database of using dataset
Yes. You simply use ADO .Net classes to handle these operations. You'd need to make a ConnectionString to the Database provider -in your case dBaseIII- using OleDbConnection class, and use SQL commands -eg. CREATE TABLE-. You can call the commands using OleDbCommand class.
Regards
|
|
|
|
|
I need to migrate dBaseIII databases to Ms-Access tables.
dBaseIII database are to be imported to MS-Access and also need export MS-Access tables to dBase III databases.
All these operations should be done using C#.
can any one help me...
Regards,
Kishore.
|
|
|
|
|
KishoreT wrote: I need to migrate dBaseIII databases to Ms-Access tables.
dBaseIII database are to be imported to MS-Access and also need export MS-Access tables to dBase III databases.
All these operations should be done using C#.
With your C# program, load the data from the dBaseIII and then insert into Access...Pretty straight forward.
Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon
|
|
|
|
|
How to get recent file names like mspaint file menu
ravi
|
|
|
|