|
how to add support for "text drag and drop" for a console application in .NET ?
it has to accept dropped text on the console window.
thanks.
|
|
|
|
|
A drop target must be there enabled in the application for it to accept drag and drop requests. Isn't it?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
not sure how I do this for a "Console" object.
|
|
|
|
|
|
hmm interesting, thanks,
still I was hoping for something more human
|
|
|
|
|
Hi...
I have problem with my timer code.
I want to display the data from the sql database on textbox using timer tick event.
For an example there are 3 data in the database which are apple,banana,coconut.
apple will appear first and after 10 seconds banana will appear, and after 10 seconds coconut will appear. And then, after the last data (coconut) appeared, the first data (apple) appeared again, and so on. It will continuously loop.
I want to do like this. Any suggestion or reference?
Thanks
Jac
|
|
|
|
|
jacklynn_mei wrote: It will continuously loop.
If you are looking at providing some interactive DHTML effect, I would suggest you look into:
http://script.aculo.us/[^]
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Do you want to do this in a web or desktop application?
I will use Google before asking dumb questions
|
|
|
|
|
|
Then, why don't you just query the database, store what you have retrieved in an object, DataSet, List...whatever...and then at the specified interval you just show a value form that object (you can use in this case a counter too).
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
I have done something like the code below
But after reading the last data, it encounter error since there is no data persistent while reading.
public partial class tempA : Form
{
SqlDataReader m_Reader;
DataSet ds = new DataSet();
private void tempA_Load(object sender, EventArgs e)
{
string conStrg;
conStrg = ("Data Source=DIMENSION3000\\SQLEXPRESS;Initial Catalog=kMasjid;User ID=sa;password=123456");
SqlConnection connTimer = new SqlConnection(conStrg);
connTimer.Open();
string selSQL = "Select txtDesc FROM txtScroll";
SqlCommand com = new SqlCommand(selSQL, connTimer);
SqlDataAdapter da = new SqlDataAdapter(com);
da.Fill(ds, "txtScroll");
m_Reader = com.ExecuteReader();
m_Reader.Read();
Timer myTimer = new Timer();
myTimer.Interval = 5000;
myTimer.Enabled = true;
myTimer.Start();
myTimer.Tick += new EventHandler(Timer_Tick);
}
public void Timer_Tick(object sender, EventArgs e)
{
alphaTxtMain.Text = " " + m_Reader["txtDesc"];
m_Reader.Read()
}
}
|
|
|
|
|
public partial class tempA : Form
{
SqlDataReader m_Reader;
DataSet ds = new DataSet();
int counter = 0;
private void tempA_Load(object sender, EventArgs e)
{
string conStrg;
conStrg = ("Data Source=DIMENSION3000\\SQLEXPRESS;Initial Catalog=kMasjid;User ID=sa;password=123456");
SqlConnection connTimer = new SqlConnection(conStrg);
connTimer.Open();
string selSQL = "Select txtDesc FROM txtScroll";
SqlCommand com = new SqlCommand(selSQL, connTimer);
SqlDataAdapter da = new SqlDataAdapter(com);
da.Fill(ds, "txtScroll");
m_Reader = com.ExecuteReader();
m_Reader.Read();
Timer myTimer = new Timer();
myTimer.Interval = 5000;
myTimer.Enabled = true;
myTimer.Start();
myTimer.Tick += new EventHandler(Timer_Tick);
}
public void Timer_Tick(object sender, EventArgs e)
{
alphaTxtMain.Text = " " + ds.Tables[0].Rows[counter++]["txtDesc"];
}
}
I will use Google before asking dumb questions
|
|
|
|
|
Thanks...
But after tried, it wont loop to the first data. After reading the 3rd data, it will error since there is no data on the position 3 (4th data) (my table only have 3 data).
|
|
|
|
|
Do we have to do everything for you? Test the counter...if it reaches the end of the DataSet, set it to 0.
I will use Google before asking dumb questions
|
|
|
|
|
Thank you very much...You've help me a lot...
Thank you...
|
|
|
|
|
Glad it turned out alright.
I will use Google before asking dumb questions
|
|
|
|
|
Hi, I've tried to open a file that is placed in a folder of web application in a editor that is made using windows application. Let us suppose i have a folder in http://localhost/MySite/MyFolder/doc.doc. Now what i need to do i want to open this file in that editor. I also want to display the file names of MyFolder. Please help me out and let me know is there any way to do so. It will be very nice of you.
Arslan Ilyas
Red Signal
|
|
|
|
|
arslanjatt wrote: a file that is placed in a folder of web application
How about a HttpWebRequest?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
I've tried this one but by using this i can read the contents of page. But i want to open a word file. It only read the html of that page. I've tried this one. Is there anything else? Thank you any ways
|
|
|
|
|
|
Hi all,
I am using StreamWriter to create a .txt file with the help of a counter. Which means, if a file is created, the title would be message1.txt. if a second file is created, the title would be message2.txt. The counter will increase everytime the button is clicked. eg. ( "message" + intCounter + ".txt")
However, when the program is closed and run again, the new content of the textbox overwrites message1.txt instead of creating a new file named "message3.txt".
I've heard of the command File.Exists so that the program checks for the latest number of the counter so that it can continue with the next number.
How is this done?
|
|
|
|
|
troubled one wrote: I've heard of the command File.Exists so that the program checks for the latest number of the counter so that it can continue with the next number.
How is this done?
File.Exists() checks to see if the file with the specified file exists on the harddrive.
troubled one wrote: I am using StreamWriter to create a .txt file with the help of a counter. Which means, if a file is created, the title would be message1.txt. if a second file is created, the title would be message2.txt. The counter will increase everytime the button is clicked. eg. ( "message" + intCounter + ".txt")
However, when the program is closed and run again, the new content of the textbox overwrites message1.txt instead of creating a new file named "message3.txt".
You'd better save the counter in the application's settings, this way you will be sure that at the next restart of the application the counter will have the last value you saved.
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
But how do you save the counter in the application's settings?
I've put "intCounter=1" at the form load.
|
|
|
|
|
In the project, there is the Properties folder. In that folder there is the Settings.settings file. Double click it and in there you can add the name of the setting, the type, scope, and value. Set the name as Counter (for ex), type int, scope User. Take a look in the designer file and make sure that there is a GET/SET property for the name you have filled in. There you can also see the namespace which you can use to get the data. Let's say that your project is called MyProj. To get or set the data from/to the counter you write:
int x = MyProj.Properties.Settings.Default.Counter;
MyProj.Properties.Settings.Default.Counter = x;
MyProj.Properties.Settings.Default.Save();
MyProj.Properties.Settings.Default.Upgrade();
The last 2 methods must be called when you change the value of the Counter from the settings.
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
You can find the no of files on a particular folder like
cmbFileNames.items.clear();
DirectoryInfo di = new DirectoryInfo("C:\My Folder");
FileInfo[] rgFiles = di.GetFiles("*.txt");
foreach (FileInfo fi1 in rgFiles)
{
string fileName = fi1.Name;
cmbFileNames.Items.Add(fileName);
}
di = null;
Here I add the all available text files into the combo box hope this helps!!!
After that your will loop through the combo and split the file names like
message3.txt I.e. message length is 7 characters and after that count and then [.txt] So this will work for any case like
message3.txt
message233.txt
message154821.txt
Convert the
-- modified at 2:07 Friday 23rd November, 2007
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|