473,471 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

scan directory selected from treeview control

5 New Member
Hi, I am doing "Virus Tracking System" Project. I have to scan the directory selected from treeview
Jan 20 '15 #1

✓ answered by Frinavale

Kiruthi,

Those examples are examples of how to use the methods to read directories.

You do not need to use the copy functionality.


-Frinny

9 2078
Frinavale
9,735 Recognized Expert Moderator Expert
Ok? "Scan"? What does "Scan" entail?

What have you tried so far?

What are you having problems with?
Getting the selected item?

-Frinny
Jan 20 '15 #2
kiruthi
5 New Member
Actually, I stored certain words related to virus in notepad. And then i am using apriori algorithm to find the number of occurrence of the words. And then i scan the single text file to determine whether that file have those words or not. Now i have to scan the directory selected from the treeview control? please help me.
Jan 21 '15 #3
Frinavale
9,735 Recognized Expert Moderator Expert
How did you populate your TreeView?

You needed to use the DirectoryInfo Class to get the listing of the directories right?

I'm assuming that the selected value of your TreeView will contain the path to the directory that you want to loop through....

You need to use the DirectoryInfo class again and use the GetFiles Method to retrieve a list of the files in that directory.

Then you need to loop through those files, determine if the file is valid for your "scanning process"... read the contents of the file and determine if it contains any of the words that you are looking for.


Take a look at the two links that I posted because they contain information and examples on how to use them.
-Frinny
Jan 21 '15 #4
kiruthi
5 New Member
Thank you. But i have to implement it in windows application. I tried your code in windows application. But it shows some error. So can u please convert it into windows application.
Jan 23 '15 #5
Frinavale
9,735 Recognized Expert Moderator Expert
It would be really helpful if you posted the error message and the line that is causing the error so that we can help you.
Jan 23 '15 #6
kiruthi
5 New Member
I don't want to copy the files one directory to another directory. I want to scan the directory.
Jan 30 '15 #7
Frinavale
9,735 Recognized Expert Moderator Expert
Kiruthi,

Those examples are examples of how to use the methods to read directories.

You do not need to use the copy functionality.


-Frinny
Jan 30 '15 #8
kiruthi
5 New Member
when the progress bar is start the timer is start with value then progress bar is stopped the process the timer is stop and total time is displayed in label box.what is the code for c#..
Feb 18 '15 #9
Arunmozhi
4 New Member
Expand|Select|Wrap|Line Numbers
  1. List<string> AllFiles = new List<string>();
  2.                 string[] filePaths = Directory.GetDirectories(@"C:\Documents and Settings\arunmozhi\My Documents\Downloads\AIRLINE DATA COLLECTIONSS\");
  3.  
  4.                 foreach (string fileName in filePaths)
  5.                 {
  6.                     String[] FileNames = Directory.GetFiles(fileName);//Get All file names from each folder
  7.  
  8.                     foreach (string textfiles in FileNames)
  9.                     {
  10.                         string[] lines = System.IO.File.ReadAllLines(textfiles);//Read all text from each files
  11.  
  12.                         for (int startline = 0; startline < lines.Length; startline++)
  13.                        {
  14. //do your codes//
  15. }
  16. }
  17. }
Mar 24 '15 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Billy Jacobs | last post by:
I have a treeview control in my application. If I right- click a node, it highlights the node but does not set it to be selected. If you move off the control it highlights the previously selected...
0
by: Mike | last post by:
Hello All, I wrote a function that will create a file system directory for my web application and display it in the IE Treeview control. Everything wrotes great! What I'm having trouble with is...
0
by: DKode | last post by:
Ok, I am creating a directory browsing app and am using the obout.com TreeView control. This is exactly what I was looking for, as of right now my code is quite sloppy and I plan on cleaning it...
1
by: Srinivasa Raghavan | last post by:
Hi All, I have some doubts on the Treeview control and Form Authentication 1) will Form Authentication work if cookies are disabled. 2) I have problem in the following code (TreeView...
17
by: Spam Trap | last post by:
I am upgrading from VB6 where I had access to a treeview NodeClick event (see below)... but now VB.NET does not have this any more. Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)...
4
by: Ben Coats | last post by:
Hey, I'm trying to find code for an Explorer-style Directory ComboBox. (You know, it display "Desktop", "My Computer", all drives, etc., but it has a treeview control inside the combobox so that...
1
by: jesper_lofgren | last post by:
Hello, Iam using Treeview control in asp.net 2.0. But have a problem. I use NavigateUrl BUT then viewstate is lost when clicked on a link i the menu. And the selected node is lost. Then i...
2
by: Pucca | last post by:
How do I make the TreeView control's node text (or label) editable when user click twice on it? (Not double click). It's like the explorer on our computer drives. The directory tree label...
1
by: Rohit111111 | last post by:
Hello all, I have a treeview control just like windows file structure.I have a treeview control on the left side of page that will populate from database upto n-level,and on click of any node i am...
3
by: dutsnekcirf | last post by:
I have a treeview control on a custom task pane in Excel. I've enable the ability to use Drag & Drop (by following this how-to) on the treeview to change the order of the nodes. The problem though...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.