SearchDirectory
-
This is C# *discussions* so I think it's ok if he doesn't have a question and is just looking for general advice. Right? Probably not gonna get it, but I think it's a valid post for this section, and shouldn't the "questions" really be going to the quick answers section or on Stack Overflow? This is the kind of thing I'd love to see here, or anywhere really... code discussions and critique is much more fun than answering dumb questions.
Jasmine2501 wrote:
This is C# *discussions* so I think it's ok if he doesn't have a question
Not according to http://www.codeproject.com/Messages/1278604/How-to-get-an-answer-to-your-question.aspx[^].
Jasmine2501 wrote:
and shouldn't the "questions" really be going to the quick answers section or on Stack Overflow?
No.
Jasmine2501 wrote:
This is the kind of thing I'd love to see here, or anywhere really... code discussions and critique is much more fun than answering dumb questions.
Then I suspect you are at the wrong place.
Use the best guess
-
The Microsoft Windows search "textbox" on the top-right corner of the Window Explorer is not too efficient when searching for files. So, I thought I should write something that would provide an easily way of searching for files in your Windows directories. There is a small application written to do a quick and smart search of files in a directory. It's still under development and your comments and contributions would be appreciated.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Data.OleDb;
using System.Data.SqlClient;namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}private void btnBrowse\_Click(object sender, EventArgs e) { // Specify a Directory name or path into the File Directory TextBox FolderBrowserDialog openDir = new FolderBrowserDialog(); //Choose a Directory path name and display on the File Direcotry TextBox if (openDir.ShowDialog() == DialogResult.OK) txtBxDir.Text = openDir.SelectedPath; else MessageBox.Show("Make sure you have selected a valid path name"); } public void searchDirectory() { //Check for valid File Type and File Directory if (cmbBx.Text == "") MessageBox.Show("Input a valid file type format"); else if (txtBxDir.Text == "") MessageBox.Show("Input a valid directory pathname"); try { //Search the specified Directory for files of a particular file type String\[\] arrayFileList = Directory.GetFiles(txtBxDir.Text, cmbBx.Text, SearchOption.AllDirectories); foreach (string file in arrayFileList) { string fileName = file.Substring(file.LastIndexOf("\\\\") + 1); txtBxResult.Text += fileName + "\\r\\n"; } } catch (IOException) { MessageBox.Show("Choose the correct file type"); } } private string getTextBoxNoFiles() { string noFiles = txtBxResult.Lines.Length.ToString(); return txtBxNoFiles.Text = noFiles; }
Do you want to search for the name of a file or for the content of a file?
-
Jasmine2501 wrote:
This is C# *discussions* so I think it's ok if he doesn't have a question
Not according to http://www.codeproject.com/Messages/1278604/How-to-get-an-answer-to-your-question.aspx[^].
Jasmine2501 wrote:
and shouldn't the "questions" really be going to the quick answers section or on Stack Overflow?
No.
Jasmine2501 wrote:
This is the kind of thing I'd love to see here, or anywhere really... code discussions and critique is much more fun than answering dumb questions.
Then I suspect you are at the wrong place.
Use the best guess
Yeah I read that, but it doesn't really make sense to have a forum if that's what it is. QA is done on Stack Overflow. This site has no purpose if it doesn't allow discussion. I think it's a good post.
-
Yeah I read that, but it doesn't really make sense to have a forum if that's what it is. QA is done on Stack Overflow. This site has no purpose if it doesn't allow discussion. I think it's a good post.
Jasmine2501 wrote:
Yeah I read that, but it doesn't really make sense to have a forum if that's what it is.
Well it's been like that since Chris set it up, and everyone seems happy that it is. I don't think changing it now would go down well with the membership.
Use the best guess
-
Yeah I read that, but it doesn't really make sense to have a forum if that's what it is. QA is done on Stack Overflow. This site has no purpose if it doesn't allow discussion. I think it's a good post.
SO is not the only place you're allowed to do QA. It doesn't have a monopoly.
Jasmine2501 wrote:
This site has no purpose if it doesn't allow discussion.
Errm, the articles are the main point of the site. Everything else has been added as a service to provide a lifeline to people with code difficulties. The right place to have posted this would have been as an article (well, more likely a tip/trick), and the discussion could have followed there. As it is, this will disappear off the front page in a couple of days, and in a couple of months people will have forgotten about it.
I was brought up to respect my elders. I don't respect many people nowadays.
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier -
Jasmine2501 wrote:
Yeah I read that, but it doesn't really make sense to have a forum if that's what it is.
Well it's been like that since Chris set it up, and everyone seems happy that it is. I don't think changing it now would go down well with the membership.
Use the best guess
But I take that as a "sticky" with just plain good advice. It doesn't say anywhere that "this is the only thing you're allowed to do here" it's just information about how to ask good questions. I've been here many years, and we used to have good discussions, back when Chris set it up, and everyone was happy, yes, you're right about that. I clicked on a tab that says "discussions" to get here. Should be orange at the top of the page right now.
-
SO is not the only place you're allowed to do QA. It doesn't have a monopoly.
Jasmine2501 wrote:
This site has no purpose if it doesn't allow discussion.
Errm, the articles are the main point of the site. Everything else has been added as a service to provide a lifeline to people with code difficulties. The right place to have posted this would have been as an article (well, more likely a tip/trick), and the discussion could have followed there. As it is, this will disappear off the front page in a couple of days, and in a couple of months people will have forgotten about it.
I was brought up to respect my elders. I don't respect many people nowadays.
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easierI meant the forum area. LOOK at the top of the page you are on right now. Does it not say "discussions" up there?
-
I meant the forum area. LOOK at the top of the page you are on right now. Does it not say "discussions" up there?
Given how long I have been an active contributor and question answerer here, I know full we'll what it says, and I also know what the purpose of the forums are for. You can capitalise whatever word you like, it still doesn't get away from the fact that these forums were always intended to be used for questions.
I was brought up to respect my elders. I don't respect many people nowadays.
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier -
But I take that as a "sticky" with just plain good advice. It doesn't say anywhere that "this is the only thing you're allowed to do here" it's just information about how to ask good questions. I've been here many years, and we used to have good discussions, back when Chris set it up, and everyone was happy, yes, you're right about that. I clicked on a tab that says "discussions" to get here. Should be orange at the top of the page right now.
Jasmine2501 wrote:
I clicked on a tab that says "discussions" to get here. Should be orange at the top of the page right now.
Big deal, it is titled "discussions", but everyone (apart from you) seems to accept that it actually means question and answer type discussions about technical problems, in fact the readmes at the top make it reasonably clear what the forum is used for. OK, you don't like that, so post a request in Bugs & Sugs, write a paper on it, or create a survey, because in a day or so this thread will disappear off the front page and be lost forever.
Use the best guess
-
Jasmine2501 wrote:
I clicked on a tab that says "discussions" to get here. Should be orange at the top of the page right now.
Big deal, it is titled "discussions", but everyone (apart from you) seems to accept that it actually means question and answer type discussions about technical problems, in fact the readmes at the top make it reasonably clear what the forum is used for. OK, you don't like that, so post a request in Bugs & Sugs, write a paper on it, or create a survey, because in a day or so this thread will disappear off the front page and be lost forever.
Use the best guess
I think that is because people don't care about learning and exploring, they just want someone else to do their job. I don't see anywhere that it's a rule.
-
I think that is because people don't care about learning and exploring, they just want someone else to do their job. I don't see anywhere that it's a rule.
-
Jasmine2501 wrote:
I don't see anywhere that it's a rule.
You also don't see anyone supporting your view.
Use the best guess
Yes, the web site designers don't seem to be here.
-
Yes, the web site designers don't seem to be here.
-
Yes, the web site designers don't seem to be here.
Perhaps there's a reason that the button at the top says "Ask a question", and the sticky notes at the top of the forum bang on about questions. Maybe the web site designers had some input there.
I was brought up to respect my elders. I don't respect many people nowadays.
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier -
Do you want to search for the name of a file or for the content of a file?
I really intend to write an article about how the search feature of Windows Explorer can be improved. However, this post is meant to address the problem with locating and highlighting a file within the "ResultTextBox" using the "Find" button in the form. I have made attempts with "select" method but still would not work.
-
What is wrong with the built in search, and how will this be better??? I think when the app starts up, don't make the user 'select' a folder, just show a treeview of their hard drive automatically. I think you need to create some classes to separate the interface logic from the searching (and this will allow multi-threading the interface later), but that discussion is not relevant without the answer to the first question.
If well built, preferably using MVS 2008, you should be able to select a directory by clicking on the "Browse" search button. When you click the search button, the directory tree of your hard drive would be displayed as "Browse For Folder" dialog box. Browse for a particular folder and click on the "Search Button". Then you can search for your preferred file type or all the files (using *.* for file type) in that directory. It is very seamless. I want to be able to select and highlight a file based on the file name the user inputs in the "TextBoxSearch".