16,004,686 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Dale 2012 (Top 200 by date)
Dale 2012
8-May-13 18:27pm
View
thank you I was being blind and not reading everything but your solution also has helped and the issue is not resolved thank you!
Dale 2012
8-May-13 18:26pm
View
Thank you I have solved this issue your comment is well appreciated and has helped a great deal!
Dale 2012
8-May-13 18:06pm
View
ok fair enough but how do you "poll" for processes? what is the syntax for that being as i cannot find a suitable way to count processes if they have the same name. A simple example would really help but I also know i have allot to learn.
Dale 2012
8-May-13 16:05pm
View
ok I will share more about the purpose of this application. It is a malware classifier that I run from a dos window then output it back to my program. I had it running on another thread as you can see which allows the program to open more than one process at a time to analyze the files in question. When the process has reached the end of the file the process is then closed to then open the next process for calculation. The problem is that it of course does not know when to stop so many processes are opened which makes things very sticky. I like the ideas of a generic list can you give any solution to that or help me to see a better way?
thank you
Dale 2012
3-May-13 3:10am
View
thank you for helping me to grasp this better it is completely foolish now that i see it this way.
Dale 2012
19-Apr-13 19:22pm
View
this solution that I have come up with works to show a message box once the string is found in the better listview but for some reason will not work if I replace msgbox("found") with item.remove?
Dim Item As BetterListViewItem
For Each Item In BetterListView1
Dim subitem As BetterListViewSubItem
subitem = Item.SubItems(1)
If subitem.Text = hiber Or subitem.Text = FXSAPI Then
MsgBox("found")
End If
Next
Dale 2012
19-Apr-13 19:13pm
View
what is Item?
Dim Osubitem As String = item.SubItems(1).Text
it is not declared and betterlistview.subitems is not a member of that control
Dale 2012
19-Apr-13 19:12pm
View
Deleted
What is Item?.... it is not declared
Dale 2012
19-Apr-13 19:11pm
View
thank you but I have read through this and cannot see where you came up with this solution. The remove all area is indeed in the MSDN link you provided but does not achieve the desired results.
Dale 2012
19-Apr-13 16:57pm
View
Ok thank you.. Is there a better method for checking if a item has been added to a listview and if true remove it?
Dale 2012
19-Apr-13 16:56pm
View
its not informative because I have no other information about the error. Where in the documentation can I view item handling with for each statements to exclude items if they are added to the subitems of the betterlistview? I have emailed and searched for the answer but cannot find anything.
Dale 2012
19-Apr-13 16:08pm
View
the program loads but it freezes with no error I am not sure why but I think it has something to do with the controls syntax being different from a normal listview
Dale 2012
19-Apr-13 16:06pm
View
I have emailed the support team there but hoped someone else on this site might know or have knowledge about this control.
Dale 2012
19-Apr-13 16:06pm
View
I hope to exclude the items from the control if found is true
If Osubitem = hiber Or Osubitem = FXSAPI Or Osubitem = setup1 Or Osubitem = setup2 Then
item.Remove()
when the item is found the program freezes. any ideas?
Dale 2012
19-Apr-13 16:05pm
View
Deleted
I have emailed the support team there but hoped someone else on this site might know or have knowledge about this control.
Dale 2012
18-Apr-13 20:22pm
View
I have looked but do not understand C programming the post is for VB.NET
Dale 2012
17-Apr-13 23:45pm
View
Very true I should be a bit more careful when naming variables thank you for this example!!
Dale 2012
13-Apr-13 10:00am
View
How were you able to intercept the API calls?... this was my original question and then output it to a textbox?... is there not some way pragmatically to accomplish this?
Dale 2012
12-Apr-13 12:41pm
View
Is there a way to hook the windows messaging service to output the API calls of a executable to a textbox or am I off course?
Dale 2012
6-Mar-13 1:48am
View
its a server client based application using IPC remoting with similar code for both the client and server. I am unsure why the CommunicationService.vb is important as the server should still pick up the string from the windows application tho i have not tested that. So my only question is where I would call a process directly instead of a console application like this does.
Dale 2012
6-Mar-13 1:42am
View
very true and i apologize for that but that is because the program works and considering the example of what you said I thought you may recognize whats happening within it while Im still trying to learn it myself.
this is my interpretation of what i think is going on correct me please if i am wrong.
Dale 2012
5-Mar-13 17:56pm
View
OK i understand the part of it to send my strings to the console but if I want to specify the exact process what part of the code i posted does this?...
Dale 2012
5-Mar-13 17:21pm
View
can you explain how to do this with any process or .exe?
Dale 2012
5-Mar-13 17:17pm
View
Ok I understand the connection from a client to a server using pipes but the process I wish to start with my program to pass strings to is not my process and i have no access to it to create the pipe. In most if not all demonstrations the client is connecting to a server console app using a pipe how can i do this with a .exe that I have not made?
Dale 2012
5-Mar-13 16:27pm
View
your scenario is at best confusing if you are some like myself trying to grasp the concept. when you talk about channels is this like application paths?... or process names?... can you give a short pseudo code or example of it?... I am not aware of all the terms you use such as objects and assembly location naming?...
Dale 2012
5-Mar-13 15:15pm
View
any ideas?...
Dale 2012
5-Mar-13 14:27pm
View
also can this example be used directly with a process and not a console window?
Dale 2012
5-Mar-13 14:27pm
View
ok without knowing exactly how this works yet I will try to ask the questions I need.
In the client window what is this?... "ipc://IPChannelName/SreeniRemoteObj" Can I specify something different here such as my process name that I wish to run the string i am sending to?.
In the window form client again there is.. Dim ipcCh As New IpcChannel("cmd.exe")
this of course does not open a CMD but refers to what?...
I need some clarification to the pink writing as I am not familiar with there meanings to this method..
Dale 2012
5-Mar-13 14:13pm
View
I have posted the code. It will be easier for me to learn if you are able to give some ideas to what Im looking to accomplish.
Dale 2012
5-Mar-13 13:56pm
View
I found a small project which uses your example to open a form with a textbox and a button which does what I want but it is a console application that listens for whatever is typed in the textbox. The code is a bit confusing to me because I cannot see where it is call the information the console window is receiving.
I know im still confused about this so I will post the code here in hopes that you will help me to understand how to implement it.
Dale 2012
5-Mar-13 13:18pm
View
Ok I have some reading to do i think I looked into it but now must figure out what parts of the process code I have, how to make work with your example. do you have any simple websites that use this example?..,
thank you I will try
Dale 2012
5-Mar-13 2:29am
View
This is very interesting, your saying I can send the filepath and arguments to the IPC channel?..
Dale 2012
4-Mar-13 14:18pm
View
OK SUCCESSS!!! I have figured it out to work will any from a any directory by simply adding the path to my recursive loop and presto its all good now thank you so much for your help!!
Dale 2012
2-Mar-13 0:34am
View
Ok I will await your response when your able to... also I thought about the recycle bin thing earlier but like i said its for all files in any dir.... nothing found so far
Dale 2012
1-Mar-13 21:15pm
View
Ok thank you for your patients with this I will tell you exactly what everything is that I hope to achieve. I forgot to change the word Disasm to filetool so in short I have a minimal command line dissembler for x86 and x64 win32 files that I hope to use with my antivirus to further my detection capabilities.
Label6.text displays the current file being scanned like so C:\folder\folder\somefile.exe
label6.text is always changing to the next file to be scanned until the scan has finished (recursive file scan)
Disasm or Disasm.exe is the executable file that is in my bin folder of my program that I am trying to use. Its funny that I can open the cmd window and type in the command manually everything works fine inside the cmd window?...
Output is the process returned from the dos window to my textbox1.text so that I do not need both the dos window and the program window... I hope that is quite possible also.
I will once again revise the code I have and update it in my question to exactly what I have in my program in hopes to solve this thing once and for all.
thank you again for your help.
Dale 2012
1-Mar-13 18:01pm
View
Hello again Mike I am still running into the same problem and have updated my code in my question to show my changes. The file is still not found when I try to run a file scan, outputting the desired string to the process filetool.exe.... I am sure the process is found but for some reason it still returns a message along with part of my string "Couldn't find C:\$Recycle.Bin\S-1-5-21-1749952126-3686413466-825947452-1000\$I0IDK36.com"
I figure that if the original string being sent was like this....
Filetool.exe C:\$Recycle.Bin\S-1-5-21-1749952126-3686413466-825947452-1000\$I0IDK36.com
then why would my returned value not read something like this?
"Couldn't find Filetool.exe C:\$Recycle.Bin\S-1-5-21-1749952126-3686413466-825947452-1000\$I0IDK36.com"
Unless the process name is not being sent to the process window somehow?....
Can that happen?.... Is there anyother way that I can run a exe more easily to output its information back to my program?..
thank you very much in advance!!
Dale 2012
28-Feb-13 13:07pm
View
The file tool that i am using i have placed in my bin folder of the project.... when i call the process from my program does it open from this directory?.... It might be a issue with it not finding the process maybe?. idk
Dale 2012
28-Feb-13 13:01pm
View
I also am aware that the files may not be found in the recycle.bin but its the same for all files in all directories..
Dale 2012
28-Feb-13 12:54pm
View
Thank you very much for this I am sure in most cases this would be enough to get things working and for the most part it does return a value back to my textbox1 but its not returning the correct information.
I should get an output of the file that I am trying to use with the filetool but instead im getting this
Couldn't find C:\$Recycle.Bin\S-1-5-21-1749952126-3686413466-825947452-1000\$I12XVFK.com
I have placed a label on the form just to monitor the string output of what should be given to the process and it looks fine:
Filetool "C:\$Recycle.Bin\S-1-5-21-1749952126-3686413466-825947452-1000\$I12XVFK.com"
I have used the code you have stated above..... Is there another way to enumerate files to pass each ones fullname as a string to the cmd line?.... thats my goal here
I will re-post what i have now maybe you can correct me where i have went wrong
thank you!!
Dale 2012
14-Jan-13 5:35am
View
thank you I decided to go with your second approach and it worked like a charm!!!
that was easy!
Dale 2012
30-Dec-12 5:53am
View
For anyone else wishing to do this I will supply the code in efforts to give back a bit
Dim selectQuery As SelectQuery
selectQuery = New SelectQuery("Win32_LogicalDisk")
Dim searcher As ManagementObjectSearcher
searcher = New ManagementObjectSearcher(selectQuery)
Dim disk As ManagementObject
For Each disk In searcher.Get()
Dim WalkHDD As String = disk.ToString
Dim HDDTrim As String = (WalkHDD.Substring(50, WalkHDD.Length - 51)) + "\"
Next
The returned string is only the drive letter which has been trimmed in the code.... if you wish to display the entire string simple delete Dim HDDTrim As String = (WalkHDD.Substring(50, WalkHDD.Length - 51)) + "\"
thank you for helping me to understand this once again
Dale 2012
30-Dec-12 5:09am
View
ok sorry for my ignorance I added it to the references and the errors are now gone thank you very much once again
Dale 2012
30-Dec-12 3:59am
View
please help
Dale 2012
30-Dec-12 3:39am
View
ok small problem I have tried the code but "SelectQuery", "ManagementObjectSearcher" and "ManagementObject" are not defined?... what would the VB.Net equivalent to this be?.. I have imported system and system management but the error is still there
Dale 2012
30-Dec-12 3:31am
View
Ok I will try this thank you very much for your insight I may post back in a few mins and accept this answer
Dale 2012
30-Dec-12 3:23am
View
As an example, the following query selects all the drives on a computer (drive C, D, and so on) that have less than 2 MB of free space:
SELECT * FROM Win32_LogicalDisk WHERE FreeSpace < 2000000
this is pretty much all i need to perform my recursive drive operations on all drives?....
Dale 2012
30-Dec-12 3:15am
View
ok thank you for your response how would this work, lets say i have no idea what the drive letter is or how many are connected?.... can I still use this method to find all hard drives \ removable drives and search through them one by one until the last one has finished?...
Dale 2012
27-Oct-12 15:49pm
View
MSDN is good for a quick and at most simple reference to any problems that you might encounter, I have looked to many sites for help before coming here but my problem is none of the ones I have seen and nothing so far that i have tried worked. I also believe that if you are here looking to answer questions then it is not a waste of my time or yours.
Dale 2012
27-Oct-12 15:40pm
View
Hello I have updated the question with c# code in hopes you can still help. Thank you for taking the time to explain this I really need to get this part right because without it I am at a large loss.
Dale 2012
26-Oct-12 21:57pm
View
I am only looking for some example with some insight into things as i am trying to learn but it is confusing to me and this code is also a bit confusing. what is FCL?
Dale 2012
24-Oct-12 23:54pm
View
the question to my problem is simply to show the recursion of the registry to a label like a scanner normally would. I would like to enumerate all levels of the registry and have a label show it. how might I accomplish this?
Dale 2012
17-Oct-12 19:10pm
View
thank you!! I have tried your suggestion to get this far
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
Private Sub OnPropertyChanged(ByVal info As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("info"))
Dim handler As PropertyChangedEventHandler
If handler IsNot Nothing Then
handler.Invoke(Me, New PropertyChangedEventArgs(info))
End If
End Sub
but I get a runtime warning on this line
If handler IsNot Nothing Then
the word handler is used before it has been assigned a value null reference exception could result in runtime error?
what value is this looking for?
thank you in advance for your help
Dale 2012
15-Sep-12 3:58am
View
thank you I have completed my objective and have the correct integer values I need to work with the database
thank you once again for all your help the question is now closed
thanks again friend!!
Dale 2012
14-Sep-12 22:24pm
View
sorry i think you miss understand my problem.. I need to do what you have shown me by code only.... I need a way to update the AU_ID with code.
my question is how might i determine the value of the last inserted value in AU_ID so that I can add one to that so it does not coflict with the database.
I think that would be the easiest way.
thank you in advance
Dale 2012
14-Sep-12 7:30am
View
This link is a bit vauge to my problem.....
All i wish to do is have some way were I do not need to add the primary key myself but have my program do it for me. I need the primary key field to be updated without the need to specify the field number in the vb.net program
any idea how to auto generate the primary key?
Dale 2012
14-Sep-12 6:17am
View
I will mark as answered once you reply
thank you once again
Dale 2012
14-Sep-12 6:17am
View
ok perfect how might i go about autogenerating the id?
Dale 2012
13-Sep-12 23:58pm
View
thank you i have the program now but would like to know if the Author Id can be excluded so that i can add anything to the rows after it....
Dale 2012
13-Sep-12 20:20pm
View
thank you for this example but I am worried to try this.... in the ID section will i be able to add my string 445323BFGF or anything i wish to add or will it need to be only numbers?..... and in the second field where author does the incerted text only can contain text or can i insert text and numbers?.... that is the origin of my question
thank you in advance
Dale 2012
11-Sep-12 1:56am
View
Your conclusion to my questions were on the money I have finally figured it out thank you once again for all your help it has been a bit confusing learning this type of thing but now that i have a much better understanding of regular expressions I am very happy to have that under my belt.
Dale 2012
10-Sep-12 20:20pm
View
I have come one step closer but with still some unwanted characters.
by using this string
(":\s\:?(.+?,)", RegexOptions.IgnoreCase)
what i get is this
:monday 23,
I need to get rid of the : and the ,
Dale 2012
10-Sep-12 20:15pm
View
can i use two regex one to match and one to exclude certain text?
Dale 2012
10-Sep-12 20:15pm
View
I only wish to see monday 23 nothing else
Dale 2012
10-Sep-12 20:00pm
View
I am parsing the string with the word "detection were:" to find the match in the string that follows monday 23 but I do not wish to display "detection were:" so that what im left with is just monday 23 or whatever follows it.
Dale 2012
10-Sep-12 11:25am
View
in your variable text as string I cannot use something so exact because its not within my knowledge what the string will be... it will change each time
Dale 2012
10-Sep-12 11:21am
View
Wow this is pretty cool I played around with the idea you have given me but the expression does not return anything unless I alter it like so....
detections were:\:?(.+?),
This will display detections were: Name,
with this expression where do i add the group 1?
I have tried it like this
"detections were:\:?(.+?),\1 but it does not return just the Name, has no change
thank you I am trying to understand and with each post its getting easier
Dale 2012
10-Sep-12 5:16am
View
thank you for this..... It does indeed display the correct to speak of but it also displays the word todays date and does not stop after the first "," mark. it goes on and on. how can I replace the unwanted text with nothing so that only the day and number show?....
thank you for you patients
Dale 2012
10-Sep-12 2:25am
View
thats my problem in general it could be any of those formats within the string. I am unsure of how to search and display only the day and number of day.
Dale 2012
10-Sep-12 0:07am
View
Can you please help me with a slight problem match?....
I am looking to match an unknown string after my match word "Today Date: ? "
the string is ended by a "," so all together it looks like this
"Today Date: Monday-23," (without the quotes)
I am trying to match the string value Monday-23 but the value or words in that part of the string are not always the same. Is it possible to match the start of the string and then to somehow determine the end of the string to only show whats in the middle of that string.....
start of string is "Today Date:"
middle of string is = "Monday-23"
end of string is = ","
thank you in advance for any insight you may have to this
cheers!!
Dale 2012
9-Sep-12 22:51pm
View
the format might also be like so...
Today Date: Monday-23-2012 or
Today Date: Monday.23-2012
thank you
Dale 2012
9-Sep-12 22:31pm
View
also the regular expression returns the word Form1 for some reason and not the string I am searching for any ideas?
Dale 2012
9-Sep-12 22:21pm
View
thank you for this explanation I have one other question to this. The date Monday 23 is not always constant and changes from time to time to what ever day and number of day relates to the string which is unknown. Will this display anything no matter if it changes?
Dale 2012
9-Sep-12 4:00am
View
how do you perform this regular expression to look for the next word to the string your matching?
Dale 2012
7-Sep-12 9:08am
View
Also i do not wish to display the first few words I used to find the word that comes after it
any ideas?
Dale 2012
7-Sep-12 9:07am
View
I have got to all most the end of whats needed but seem to be having some problems understanding the circumstance of what to do when I need to find a string by the first few words and then to display whats to the right of it which is then ended by a , mark?
Dale 2012
7-Sep-12 7:44am
View
thank you for this friend !! the program seems a bit confusing but with this I should do fine thank you all for your help I appreciate it very much
Dale 2012
7-Sep-12 7:39am
View
thank you thank you!!
Dale 2012
7-Sep-12 7:39am
View
Works Beautifully YOU ARE awesome thank you so much for this !!!!
Dale 2012
7-Sep-12 7:28am
View
ok so far I got it to display "out of 42" which is so close to what i need but I cannot seem to get the first value to show
eg. "6 out of 42"
this is the string i have so far
Dim Detection As New Regex("out of .{1,3}", RegexOptions.IgnoreCase)
any ideas how i might fix this?
thank you for the useful tool
Dale 2012
6-Sep-12 20:16pm
View
I have read about these methods but I still need some example of how to read the html from my rich textbox to find the strings I am looking for. It is not always known to me what the numbers are so a predefined value to search for like 25 or 32 will not work I need to search or parse strings that are like " 1 out of 0" and so on. also functions such as instr, mid and split are old and may cause a performance hit to the program.
I have google searched for hours but cannot figure this out please provide some example
thank you for your input!
Dale 2012
6-Sep-12 19:14pm
View
thank you very much!!
Dale 2012
5-Sep-12 16:16pm
View
this will probably work but can you give a bit more insight into how to parse html and the nodes that you are talking of.
thank you
Dale 2012
13-Aug-12 9:25am
View
will this code work if i place it correctly into a background worker from what you see?
Dale 2012
12-Aug-12 19:10pm
View
I left code before but it was some how deleted can this be changed to iterate one folder by one folder so that each folder that is accessed is added to a count one by one and not all at once?
Dale 2012
12-Aug-12 19:09pm
View
Public Function CountDirectories(ByVal dir As DirectoryInfo) As Integer
Try
Dim MySubdirs() As DirectoryInfo = dir.GetDirectories()
Dim count As Integer = MySubdirs.Length
For Each subDir As DirectoryInfo In MySubdirs
count += CountDirectories(subDir)
Next subDir
Return count
Catch ex As Exception
End Try
End Function
Dim MyDirectoryInfo As New DirectoryInfo(pathToSearchCombo.Text)
Dim Mytotalcount As Integer = CountDirectories(MyDirectoryInfo)
Label12.Text = Mytotalcount
Dale 2012
12-Aug-12 2:21am
View
I have done exactly what you have said by placing the count directories within a background worker and then calling it from my iteration but again it returns a one lump sum of how many directories instead of counting normally one folder by one folder.
Dale 2012
11-Aug-12 23:44pm
View
I have posted some code that I am using. will you assist me with this issue please?
thank you very much!
Dale 2012
11-Aug-12 23:16pm
View
I am aware of how to count files as they iterate but I wish to count the folders that contain the files to a different string or label as it iterates. Can you give a link or example of how this is done?
thank you in advance
Dale 2012
10-Aug-12 4:43am
View
Ok this is a bit confusing your reply is is saying that I should change
Dim Root As New DirectoryInfo("SearchPath eg. C:\")
to
dim root = directory.getdirectories("C:\")
but then you go to say directoryinfo takes a valid path so it should be directoryinfo ("C:\") ??????
I have got the code to all ready return all folder count for the first level of C:\ but it does not go any further....
I need this to go recrusivly into all area's of the C:\ to return a full folder count to my label...
thank you for your response can you plz add a bit to this so that it works??
cheers!
Dale 2012
6-Jul-12 1:49am
View
to be perfectly honest I have found a real nice example here on code project with the name ScanX which is a registry cleaner. How and where might I start when it comes to simply enumerating the registry root keys and sub keys so that I can start to code the parts that will check the registry for invalid objects?. At this point I would like to pass each key being enumerated to a label so that it will be visible. I will not ask questions like how do I make a registry cleaner of course but it would be of great help if you or someone could supply a small example of just that using the microsoft.win32.registry class that you talk of.
thank you very much your response is just what i needed to hear so that I dont pull my hair out with old code!!
Dale 2012
2-Jul-12 21:16pm
View
Please I have asked how it is possible to report the progress of my filesystem enumeration to a progress bar and am still waiting for a decient answer as to how i can go about it. There is not much on the internet about this problem.
thank you in advance --SA
Dale 2012
1-Jul-12 6:13am
View
I wish to show the completeness of the files or directory I am enumerating through in a progressbar and also to show the percentage completed in a label. If you say its possible to use a background worker to accomplish this task I am dieing to learn so that I can keep what i have learned for future projects and move on. Thank you I know that I have allot to learn and is the reason for my questions!
Dale 2012
1-Jul-12 3:57am
View
Is it not possible to use a background worker and set the report progress to some how drive my progressbar?..... please let me know if that is possible
thank you
Dale 2012
1-Jul-12 3:13am
View
my problem is that I cannot determine the values because depending on what computer the program is run on the values will always be different.
What other values can I use to come close or be exact?
Dale 2012
1-Jul-12 3:06am
View
Ok but even if I use string format and or system text stringbuilder, I am still lost as to what your saying when it comes to setting the values of the progressbar min and max. I can go over the code to make corrections for performance but right now its not my issue. Is there any easy way to display the progress while enumberating the filesystem?
Dale 2012
30-Jun-12 23:43pm
View
any ideas or input?
Dale 2012
27-Jun-12 17:50pm
View
I am unaware of your personal life and appologise to ask you sorry for sounding inconsiderate to your time constraints but I thank you for your input I will just have to keep trying...
Dale 2012
27-Jun-12 14:47pm
View
the file in question is C# which i have converted to vb.net I hope that you will be familar with C# to help me with this as its really the last step that i need
again my main goal of all this is to enumerate all files but only calculate the md5 hash for the files that match my criteria.
Dale 2012
27-Jun-12 14:44pm
View
yes I have done that with nonfilespec as string = "*.*" which finds all files and I have tried myextensions as new list of string that looks like "txt","exe" and so forth but it does not seem to fit my eariler sub with the parameters given and I have tried to do the work myself for the past few days which may sound pathetic but true. Would you have time to look at the file?
http://www.codeproject.com/Articles/12782/File-System-Enumerator-using-lazy-matching
thank you so much!!
Dale 2012
27-Jun-12 0:26am
View
Ok I think I have narrowed the code down to this
Public Sub New(ByVal pathsToSearch As String, ByVal fileTypesToMatch As String, ByVal includeSubDirs As Boolean)
m_scopes = New Stack(Of SearchInfo)()
If Nothing Is pathsToSearch Then
Throw New ArgumentNullException("pathsToSearch")
End If
If Nothing Is fileTypesToMatch Then
Throw New ArgumentNullException("fileTypesToMatch")
End If
If fileTypesToMatch.IndexOfAny(New Char() {":"c, "<"c, ">"c, "/"c, "\"c}) >= 0 Then
Throw New ArgumentException("invalid cahracters in wildcard pattern", "fileTypesToMatch")
End If
m_includeSubDirs = includeSubDirs
m_paths = pathsToSearch.Split(New Char() {";"c, ","c})
Dim specs() As String = fileTypesToMatch.Split(New Char() {";"c, ","c})
m_fileSpecs = New List(Of Regex)(specs.Length)
For Each spec As String In specs
Dim pattern As String = spec.Trim().Replace(".", "\.").Replace("*", ".*").Replace("?", ".?")
m_fileSpecs.Add(New Regex(String.Format("^{0}$", pattern), RegexOptions.IgnoreCase))
Next spec
End Sub
I believe that the error is within this statement and is the reason for the count to be messed up.
you use a format like so
MyExtensions.AddRange({"txt", "exe", "dat"})
and the string format that is being used is
"*.exe;,*.txt;,*.com;"
What needs to change in this sub so that the list of string can read the format of the sting?
thank you for being so parient
Dale 2012
26-Jun-12 16:02pm
View
Deleted
Dim MyExtensions As New List(Of String)
MyExtensions.AddRange({"txt", "exe", "dat"})
Try
Using fse As New FindFiles.FileSystemEnumerator(pathToSearchCombo.Text, nonfilespec, True)
Dim ien As IEnumerator(Of FileInfo) = fse.Matches().GetEnumerator()
ien.Dispose()
For Each fi As FileInfo In fse.Matches
If MyExtensions.Contains(fi.Extension.ToLower()) Then
Fcount += 1
Label3.Text = Fcount.ToString
Else
Dim FHash As String = getmd5hash(fi.FullName)
Dim sql = "SELECT MD5Signature FROM Query1 WHERE MD5Signature='" & FHash & "'"
cmd = New OleDbCommand(sql, conn)
Dim dr As OleDbDataReader = cmd.ExecuteReader
Fcount += 1
Label3.Text = Fcount.ToString
Label6.Text = fi.FullName
Label9.Text = getmd5hash(fi.FullName)
Do While dr.Read = True
ColumnHeader1.ListView.Items.Add(fi.Name + " " + FHash.ToString)
Label4.Text = ColumnHeader1.ListView.Items.Count.ToString
Loop
dr.Close()
End If
If cancel Then
Exit For
End If
Next fi
conn.Close()
conn.Open()
PictureBox1.Visible = False
pathToSearchCombo.Enabled = True
End Using
Catch ex As Exception
End Try
It still calculates all checksums for some reason??
Dale 2012
26-Jun-12 16:00pm
View
ok i have tried
Dale 2012
26-Jun-12 10:47am
View
Thats correct!! .... my filespecscombo extensions are seperated like so *.exe;*.txt;*.gif and so on. the nonfilespec is just simply *.* to look for all files. both filespecs and nonfilespecs are dim as string, how might I correct this problem?
thank you for responding
Dale 2012
26-Jun-12 0:45am
View
it does not seem to make any difference if I change
If fi.Extension = filespecscombo Then
Fcount += 1
Label3.Text = Fcount.ToString
Else
to
If fi.Extension = nonfilespecs Then
Fcount += 1
Label3.Text = Fcount.ToString
Else
Dale 2012
26-Jun-12 0:43am
View
Deleted
I understand the simple math behind what needs to happen but for some reason the sub is still calculating the md5 check sums for all files and not just the specified file extensions that i am looking for here is what i have so far:
Try
Using fse As New FindFiles.FileSystemEnumerator(pathToSearchCombo.Text, nonfilespec, True)
Dim ien As IEnumerator(Of FileInfo) = fse.Matches().GetEnumerator()
ien.Dispose()
For Each fi As FileInfo In fse.Matches
If fi.Extension = filespecscombo Then
Fcount += 1
Label3.Text = Fcount.ToString
Else
Dim FHash As String = getmd5hash(fi.FullName)
Dim sql = "SELECT MD5Signature FROM Query1 WHERE MD5Signature='" & FHash & "'"
cmd = New OleDbCommand(sql, conn)
Dim dr As OleDbDataReader = cmd.ExecuteReader
Fcount += 1
Label3.Text = Fcount.ToString
Label6.Text = fi.FullName
Label9.Text = getmd5hash(fi.FullName)
Do While dr.Read = True
ColumnHeader1.ListView.Items.Add(fi.Name + " " + FHash.ToString)
Label4.Text = ColumnHeader1.ListView.Items.Count.ToString
Loop
dr.Close()
End If
If cancel Then
Exit For
End If
Next fi
conn.Close()
conn.Open()
PictureBox1.Visible = False
pathToSearchCombo.Enabled = True
End Using
Catch ex As Exception
End Try
Dale 2012
25-Jun-12 21:15pm
View
I want to count both files that match and files that do not but only carry out calculations on the files that match
Dale 2012
25-Jun-12 20:50pm
View
My last problem to all of this is only counting the files that do not match and to not carry out any other operations on thoes files. I have tried to add the routine within the if fi.extension statement to finally get it to correctly count the total number of files but for some reason it is still doing the calculations on all files and not just the files that match.
Dale 2012
25-Jun-12 1:13am
View
Deleted
allfiles-filethatdonotmatch will not fit what i need to do here. I have created a new string called nonfilespec = *.* which finds all files but I only wish to perform calculations on the files that match and only wish the add the files that do not to the count then goto the next file.
I have tried this code but it seems to still return a short file count once the enumeration has reached the end.
Using fse As New FindFiles.FileSystemEnumerator(pathToSearchCombo.Text, nonfilespecs, True)
Dim ien As IEnumerator(Of FileInfo) = fse.Matches().GetEnumerator()
ien.Dispose()
For Each fi As FileInfo In fse.Matches
If fse.ToString.Contains(filespecs) Then
Fcount = Fcount + 1
Else
Fcount = Fcount + 1
End If
can you please show me what is wrong with my logic?
Dale 2012
2-Jun-12 19:54pm
View
thank you very much for that info
Dale 2012
2-Jun-12 19:45pm
View
the query would be the file extensions I am searching for I think and the performance would be compared to a normal iteration vs a faster method if any
Dale 2012
2-Jun-12 19:25pm
View
no
Dale 2012
11-May-12 0:28am
View
thank you very much I have read the article and will also give this a 5 with accepted answer.
take care thank you!
Dale 2012
7-May-12 2:49am
View
It is not the public subs that i am worried about if you have read my question. I understand that only public subs will be visible in the dll but its only the public subs in the .cls file that show and not the public subs in the .bas files
Dale 2012
7-May-12 2:41am
View
What are you talking about?
Dale 2012
5-May-12 2:49am
View
Thank you this is not a bad solution to my problem except it does not show how to access the public subs in my .bas files from the dll.
any suggestions?
Dale 2012
3-May-12 22:15pm
View
ok what suggestions can you make about the copy memory crap? I am unsure of how or where to find examples that use this method
Dale 2012
22-Apr-12 18:42pm
View
<pre lang="vb">Private Sub Command1_Click(ByVal eventSender As Object, ByVal eventArgs As EventArgs) Handles Command1.Click
Dim u As Object
cd1Open.ShowDialog()
If Strings.Len(cd1Open.FileName) = 0 Then Exit Sub
FileSystem.FileOpen(1, cd1Open.FileName, OpenMode.Binary)
ReDim FDATA(FileSystem.LOF(1) - 1)
'UPGRADE_WARNING: (2080) Get was upgraded to FileGet and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx
FileSystem.FileGet(1, FDATA, -1)
FileSystem.FileClose(1)
If ReadPE(FDATA) = 0 Then
MessageBox.Show("File is not Win32 Executeable!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error) : Exit Sub
End If</pre>
<pre lang="vb">'UPGRADE_WARNING: (2080) Form_Load event was upgraded to Form_Load method and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx
Private Sub Form_Load()
Top = (Screen.PrimaryScreen.Bounds.Height - Height) / 2
Left = (Screen.PrimaryScreen.Bounds.Width - Width) / 2
End Sub</pre>
Also I am having problems with this bit of code..
<pre lang="vb">Public Function ReadPE(ByRef DATA() As Byte) As Byte
On Error GoTo ErrX
Dim CNT As Integer
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
UpgradeSolution1Support.SafeNative.kernel32.CopyMemory(DOSHEADER, DATA(CNT), CShort(Marshal.SizeOf(DOSHEADER)))
If DOSHEADER.e_magic.Value <> "MZ" Then Exit Function
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
UpgradeSolution1Support.SafeNative.kernel32.CopyMemory(NTHEADER, DATA(DOSHEADER.e_lfanew), CShort(Marshal.SizeOf(NTHEADER)))
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
CNT = CNT + DOSHEADER.e_lfanew + Marshal.SizeOf(NTHEADER)
If NTHEADER.Signature.Value <> "PE" & Strings.Chr(0).ToString() & Strings.Chr(0).ToString() Then Exit Function
ReDim SECTIONSHEADER(NTHEADER.FileHeader.NumberOfSections - 1)
For Each SECTIONSHEADER_item As IMAGE_SECTION_HEADER In SECTIONSHEADER
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
'UpgradeSolution1Support.SafeNative.kernel32.CopyMemory(SECTIONSHEADER_item, DATA(CNT), CShort(Marshal.SizeOf(SECTIONSHEADER(0))))
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
CNT += Marshal.SizeOf(SECTIONSHEADER(0))
Next SECTIONSHEADER_item
Return 1
ErrX:
On Error GoTo 0
End Function
any suggestion will be great as how to convert this to vb.net
Dale 2012
22-Apr-12 18:41pm
View
Deleted
<pre lang="vb">Private Sub Command1_Click(ByVal eventSender As Object, ByVal eventArgs As EventArgs) Handles Command1.Click
Dim u As Object
cd1Open.ShowDialog()
If Strings.Len(cd1Open.FileName) = 0 Then Exit Sub
FileSystem.FileOpen(1, cd1Open.FileName, OpenMode.Binary)
ReDim FDATA(FileSystem.LOF(1) - 1)
'UPGRADE_WARNING: (2080) Get was upgraded to FileGet and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx
FileSystem.FileGet(1, FDATA, -1)
FileSystem.FileClose(1)
If ReadPE(FDATA) = 0 Then
MessageBox.Show("File is not Win32 Executeable!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error) : Exit Sub
End If</pre>
<pre lang="vb">'UPGRADE_WARNING: (2080) Form_Load event was upgraded to Form_Load method and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx
Private Sub Form_Load()
Top = (Screen.PrimaryScreen.Bounds.Height - Height) / 2
Left = (Screen.PrimaryScreen.Bounds.Width - Width) / 2
End Sub</pre>
Also I am having problems with this bit of code..
<pre lang="vb">Public Function ReadPE(ByRef DATA() As Byte) As Byte
On Error GoTo ErrX
Dim CNT As Integer
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
UpgradeSolution1Support.SafeNative.kernel32.CopyMemory(DOSHEADER, DATA(CNT), CShort(Marshal.SizeOf(DOSHEADER)))
If DOSHEADER.e_magic.Value <> "MZ" Then Exit Function
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
UpgradeSolution1Support.SafeNative.kernel32.CopyMemory(NTHEADER, DATA(DOSHEADER.e_lfanew), CShort(Marshal.SizeOf(NTHEADER)))
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
CNT = CNT + DOSHEADER.e_lfanew + Marshal.SizeOf(NTHEADER)
If NTHEADER.Signature.Value <> "PE" & Strings.Chr(0).ToString() & Strings.Chr(0).ToString() Then Exit Function
ReDim SECTIONSHEADER(NTHEADER.FileHeader.NumberOfSections - 1)
For Each SECTIONSHEADER_item As IMAGE_SECTION_HEADER In SECTIONSHEADER
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
'UpgradeSolution1Support.SafeNative.kernel32.CopyMemory(SECTIONSHEADER_item, DATA(CNT), CShort(Marshal.SizeOf(SECTIONSHEADER(0))))
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
CNT += Marshal.SizeOf(SECTIONSHEADER(0))
Next SECTIONSHEADER_item
Return 1
ErrX:
On Error GoTo 0
End Function
any suggestion will be great as how to convert this to vb.net
Dale 2012
22-Apr-12 18:41pm
View
Deleted
<pre lang="vb">Private Sub Command1_Click(ByVal eventSender As Object, ByVal eventArgs As EventArgs) Handles Command1.Click
Dim u As Object
cd1Open.ShowDialog()
If Strings.Len(cd1Open.FileName) = 0 Then Exit Sub
FileSystem.FileOpen(1, cd1Open.FileName, OpenMode.Binary)
ReDim FDATA(FileSystem.LOF(1) - 1)
'UPGRADE_WARNING: (2080) Get was upgraded to FileGet and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx
FileSystem.FileGet(1, FDATA, -1)
FileSystem.FileClose(1)
If ReadPE(FDATA) = 0 Then
MessageBox.Show("File is not Win32 Executeable!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error) : Exit Sub
End If</pre>
<pre lang="vb">'UPGRADE_WARNING: (2080) Form_Load event was upgraded to Form_Load method and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx
Private Sub Form_Load()
Top = (Screen.PrimaryScreen.Bounds.Height - Height) / 2
Left = (Screen.PrimaryScreen.Bounds.Width - Width) / 2
End Sub</pre>
Also I am having problems with this bit of code..
<pre lang="vb">Public Function ReadPE(ByRef DATA() As Byte) As Byte
On Error GoTo ErrX
Dim CNT As Integer
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
UpgradeSolution1Support.SafeNative.kernel32.CopyMemory(DOSHEADER, DATA(CNT), CShort(Marshal.SizeOf(DOSHEADER)))
If DOSHEADER.e_magic.Value <> "MZ" Then Exit Function
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
UpgradeSolution1Support.SafeNative.kernel32.CopyMemory(NTHEADER, DATA(DOSHEADER.e_lfanew), CShort(Marshal.SizeOf(NTHEADER)))
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
CNT = CNT + DOSHEADER.e_lfanew + Marshal.SizeOf(NTHEADER)
If NTHEADER.Signature.Value <> "PE" & Strings.Chr(0).ToString() & Strings.Chr(0).ToString() Then Exit Function
ReDim SECTIONSHEADER(NTHEADER.FileHeader.NumberOfSections - 1)
For Each SECTIONSHEADER_item As IMAGE_SECTION_HEADER In SECTIONSHEADER
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
'UpgradeSolution1Support.SafeNative.kernel32.CopyMemory(SECTIONSHEADER_item, DATA(CNT), CShort(Marshal.SizeOf(SECTIONSHEADER(0))))
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
CNT += Marshal.SizeOf(SECTIONSHEADER(0))
Next SECTIONSHEADER_item
Return 1
ErrX:
On Error GoTo 0
End Function
any suggestion will be great as how to convert this to vb.net
Dale 2012
22-Apr-12 18:40pm
View
Deleted
<pre lang="vb">Private Sub Command1_Click(ByVal eventSender As Object, ByVal eventArgs As EventArgs) Handles Command1.Click
Dim u As Object
cd1Open.ShowDialog()
If Strings.Len(cd1Open.FileName) = 0 Then Exit Sub
FileSystem.FileOpen(1, cd1Open.FileName, OpenMode.Binary)
ReDim FDATA(FileSystem.LOF(1) - 1)
'UPGRADE_WARNING: (2080) Get was upgraded to FileGet and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx
FileSystem.FileGet(1, FDATA, -1)
FileSystem.FileClose(1)
If ReadPE(FDATA) = 0 Then
MessageBox.Show("File is not Win32 Executeable!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error) : Exit Sub
End If</pre>
<pre lang="vb">'UPGRADE_WARNING: (2080) Form_Load event was upgraded to Form_Load method and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx
Private Sub Form_Load()
Top = (Screen.PrimaryScreen.Bounds.Height - Height) / 2
Left = (Screen.PrimaryScreen.Bounds.Width - Width) / 2
End Sub</pre>
Also I am having problems with this bit of code..
<pre lang="vb">Public Function ReadPE(ByRef DATA() As Byte) As Byte
On Error GoTo ErrX
Dim CNT As Integer
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
UpgradeSolution1Support.SafeNative.kernel32.CopyMemory(DOSHEADER, DATA(CNT), CShort(Marshal.SizeOf(DOSHEADER)))
If DOSHEADER.e_magic.Value <> "MZ" Then Exit Function
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
UpgradeSolution1Support.SafeNative.kernel32.CopyMemory(NTHEADER, DATA(DOSHEADER.e_lfanew), CShort(Marshal.SizeOf(NTHEADER)))
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
CNT = CNT + DOSHEADER.e_lfanew + Marshal.SizeOf(NTHEADER)
If NTHEADER.Signature.Value <> "PE" & Strings.Chr(0).ToString() & Strings.Chr(0).ToString() Then Exit Function
ReDim SECTIONSHEADER(NTHEADER.FileHeader.NumberOfSections - 1)
For Each SECTIONSHEADER_item As IMAGE_SECTION_HEADER In SECTIONSHEADER
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
'UpgradeSolution1Support.SafeNative.kernel32.CopyMemory(SECTIONSHEADER_item, DATA(CNT), CShort(Marshal.SizeOf(SECTIONSHEADER(0))))
'UPGRADE_WARNING: (2081) Len has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2081.aspx
CNT += Marshal.SizeOf(SECTIONSHEADER(0))
Next SECTIONSHEADER_item
Return 1
ErrX:
On Error GoTo 0
End Function
any suggestion will be great as how to convert this to vb.net
Dale 2012
22-Apr-12 10:59am
View
yes.... I understand that "file" is used when you want to copy, move or delete a file and getfile Returns a File Object corresponding to the file in a specified path. My question was will the upgraded "getFile" still act in the same mannor?
Dale 2012
21-Apr-12 8:12am
View
Deleted
let me know if and how you will like me to send it! :)
Dale 2012
17-Apr-12 15:57pm
View
You are 100% correct!!! Thank you
the code that consists of the pointers is:
Public Function ReadPE(ByRef DATA() As Byte) As Byte
On Error GoTo ErrX
Dim CNT As Integer
Dim u As Integer
'UPGRADE_WARNING: Couldn't resolve default property of object DOSHEADER. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
CopyMemory(DOSHEADER, DATA(CNT), Len(DOSHEADER))
If DOSHEADER.e_magic <> "MZ" Then Exit Function
'UPGRADE_WARNING: Couldn't resolve default property of object NTHEADER. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
CopyMemory(NTHEADER, DATA(DOSHEADER.e_lfanew), Len(NTHEADER))
CNT = CNT + DOSHEADER.e_lfanew + Len(NTHEADER)
If NTHEADER.Signature <> "PE" & Chr(0) & Chr(0) Then Exit Function
ReDim SECTIONSHEADER(NTHEADER.FileHeader.NumberOfSections - 1)
For u = 0 To UBound(SECTIONSHEADER)
'UPGRADE_WARNING: Couldn't resolve default property of object SECTIONSHEADER(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
CopyMemory(SECTIONSHEADER(u), DATA(CNT), Len(SECTIONSHEADER(0)))
CNT = CNT + Len(SECTIONSHEADER(0))
Next u
ReadPE = 1
Exit Function
ErrX:
On Error GoTo 0
End Function
Can you or someone give an example of how to use the marshal class in my case?
DOSHEADER, NTHEADER, SECTIONSHEADER seem to be the issue now. I need to copy the memory with marshal class but how, please help once more
thank you in advance
cheers!!
Dale 2012
17-Apr-12 13:50pm
View
yes I am sorry for the double post but I figured that I would receive a response sooner as vb6 is not visited as frequently as vb.net, being old and all.
Dale 2012
17-Apr-12 10:00am
View
Thank you very much for your reply. I suppose by your answer the best way for me to use a debugger from with in my program might be by means of a wrapper but again I am lost as how to do so. I plan to use it for static analysis to detect malicious code in the files being scanned. In my efforts I have found a vb6 disassembler but I am having some problems please take a look when you have the time, I would be very thankful for your participation.
http://www.codeproject.com/Questions/368012/Copy-Memory-Problem-Please-Help
Dale 2012
12-Apr-12 2:43am
View
Do you need to write a plugin for vb.net to interact with ollydbg?....
Dale 2012
12-Apr-12 2:41am
View
I do not wish to disassemble vb.net projects but rather to use ollydbg from within my application.
Dale 2012
1-Apr-12 15:22pm
View
I understand the complexities of the problem and only wish for someone to write a brief explanation or checklist for something to start from. anything right down to how to emulate a file system and how to open the file inside the virtual environment.
Dale 2012
4-Mar-12 5:24am
View
your example is great but would it be similar to how access database works? I cannot seem to figure out ADODB.recordset.
please help
Dale 2012
20-Feb-12 3:54am
View
examples or provided sample code preferably for vb.net
Dale 2012
20-Feb-12 3:50am
View
I do not wish to create a data column on my windows form to then add or create tables to. I wish to return a string from a database table to two listview columns.
------------------------------------------------------------------------------
example:
------------------------------------------------------------------------------
database:
(Table) Appearance
(Cell Value)LongHair,BlueEyes (as one string divided by a ",")
------------------------------------------------------------------------------
listview:
(columns) Hair type Eye Color
(items) LongHair BlueEyes
Dale 2012
20-Feb-12 3:31am
View
the connection string was wrong entirely.
for others that might have had the same problem the correct format of the connection string is
"SELECT table FROM database WHERE table='" & "'"
Dale 2012
20-Feb-12 3:22am
View
there was a slight misunderstanding. The point of my counter is to be seen by the user. I have solved my question and thank you and others here for there posts.
Dale 2012
18-Feb-12 1:07am
View
I have read that a iterator will keep track of the current position in the traversal of the aggregate. Is this why I cannot simply set the count of my label back to 0?
Dale 2012
18-Feb-12 0:48am
View
I must use a label to show the file count of the current file being scanned on my filesystem right? how else can I see it if its not shown in a label?
Dale 2012
18-Feb-12 0:46am
View
you might have misunderstood my question or I do not understand your answer. I am looking to reset my label to zero when the scan procedure of my iterator block finishes. Thus far what happens is, the scan through my filesystem finishes and when I click the start button again the counting label does not start again at zero. It starts where it left off and the iterator function starts from the begging again. This also happens when I cancel the scan. How can I count the files being scanned with the iterator and then zero it off when I want to start a new scan?
Dale 2012
17-Feb-12 18:27pm
View
Dhol your code runs 1 to 10000 and then starts my count again where it left off. the label does not refresh
Dale 2012
3-Feb-12 19:23pm
View
Do you normally ask questions to which you know the answers?. I thank you for the response but am tired of hearing the expression "pick up a book" lol its the age of computers and the internet is a much better resource than any book I have ever read.
Is this site not for asking questions?......
Dale 2012
2-Feb-12 21:03pm
View
well........ I do have two tables .... do i need to first name the table and then the column row of the table?
Dale 2012
2-Feb-12 11:54am
View
If I fix the line: strSearch = "Select * FROM [MD5 Hash Signature]"
to
strSearch = "Select * FROM MD5 Hash Signature"
I get an error:
Syntax error in FROM clause.
why?.......
Dale 2012
2-Feb-12 11:49am
View
Ok I have come up with this but it still is not working.........
Imports System.Data.OleDb
Public Class Form1
Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
cn = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Admin\Desktop\File Enumerator VB.Net\bin\Debug\AVDatabaseX64.accdb;Persist Security Info=True")
cn.Open()
Dim strSearch As String
strSearch = "Select * FROM [MD5 Hash Signature]"
cmd = New OleDbCommand(strSearch, cn)
dr = cmd.ExecuteReader
While dr.Read
If dr(1) = txtSearch.Text Then
Label2.Text = +1
End If
End While
cn.Close()
dr.Close()
End Sub
End Class
It comes up with an error:
The Microsoft Office Access database engine cannot find the input table or query 'MD5 Hash Signature'. Make sure it exists and that its name is spelled correctly.
Dale 2012
1-Feb-12 14:02pm
View
I would like to get away from using a text file as a means to store my signatures. Your right by saying that I do not wish to display the information from the database unless a match is found. The program calculates the hash of the file being scanned in my computer and then that hash is compared against my definitions in my for now text file, hope to be database soon.
Dale 2012
1-Feb-12 14:00pm
View
I can run SQL on access database?...... Im a bit confused now as to what you mean. Can you give an example of what your talking about please?
Dale 2012
31-Jan-12 5:14am
View
Settings5.AVDatabaseX64ConnectionString = (resources.GetString("Settings5.AVDatabaseX64ConnectionString")) as string
This is designer code and does not accept the "as string" that you have stated
Dale 2012
31-Jan-12 4:10am
View
Thank you for this now i am on another error :(
Dale 2012
30-Jan-12 9:58am
View
I cannot figure out how or where to go with this
Dale 2012
30-Jan-12 9:58am
View
I am also using iterator functions........ Is there any known issues with this?
Dale 2012
30-Jan-12 9:42am
View
Ok i have Dim con As New OleDb.OleDbConnection and in my form load i have
con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Admin\Desktop\File Enumerator VB.Net\bin\Debug\Virus Signature Database_be - Copy.accdb;Persist Security Info=False;"
but the same line of code errors again:
<pre lang="vb">'TODO: This line of code loads data into the '_Virus_Signature_Database_be___CopyDataSet.CRC32_Virus_Database' table. You can move, or remove it, as needed.
Me.CRC32_Virus_DatabaseTableAdapter.Fill(Me._Virus_Signature_Database_be___CopyDataSet.CRC32_Virus_Database)
'TODO: This line of code loads data into the '_Virus_Signature_Database_be___CopyDataSet.MD5_Virus_Database' table. You can move, or remove it, as needed.
Me.MD5_Virus_DatabaseTableAdapter.Fill(Me._Virus_Signature_Database_be___CopyDataSet.MD5_Virus_Database)</pre>
Dale 2012
30-Jan-12 9:30am
View
Where do I place the connection string? please advise?
Dale 2012
30-Jan-12 9:29am
View
Line of code on error line:
<pre lang="vb">'TODO: This line of code loads data into the '_Virus_Signature_Database_be___CopyDataSet.CRC32_Virus_Database' table. You can move, or remove it, as needed.
Me.CRC32_Virus_DatabaseTableAdapter.Fill(Me._Virus_Signature_Database_be___CopyDataSet.CRC32_Virus_Database)
'TODO: This line of code loads data into the '_Virus_Signature_Database_be___CopyDataSet.MD5_Virus_Database' table. You can move, or remove it, as needed.
Me.MD5_Virus_DatabaseTableAdapter.Fill(Me._Virus_Signature_Database_be___CopyDataSet.MD5_Virus_Database)</pre>
Dale 2012
30-Jan-12 7:12am
View
Hey thanks I figured out that error and now face this one lol
The ConnectionString property has not been initialized.
and the line of code is
Me.CRC32_Virus_DatabaseTableAdapter.Fill(Me._Virus_Signature_Database_be___CopyDataSet.CRC32_Virus_Database)
and also:
Me.MD5_Virus_DatabaseTableAdapter.Fill(Me._Virus_Signature_Database_be___CopyDataSet.MD5_Virus_Database)
The CRC32 is a table adapter and so is the MD5 virus database. I know the error is because I need to open the connection but I do not know how. I am a very visual learner and even though I want nothing more than to learn I understand somewhat of the terms but grasp it better for the long term if I can see it and also do it for myself. Long story short how can I open my database connection for access database? thanks in advance
Dale 2012
29-Jan-12 19:41pm
View
I know your right but it seems to be such a simple error holding me back at this point
Dale 2012
29-Jan-12 19:41pm
View
ok so besides going back to the drawing board once more and reading for hours more is there any other advise you may give?
Dale 2012
29-Jan-12 19:23pm
View
This is all form generated code not anything I have done. the code is in my settings designer and was generated when I added my access database to my project. sounds lame to ask but what is the setter?
Dale 2012
29-Jan-12 19:14pm
View
Im not sure this helps but if it does im waiting patiently to hear your response
thank you so much for what you have contributed thus far
Dale 2012
29-Jan-12 19:13pm
View
Maybe this might give you some insight as to the problem im having
<global.system.configuration.applicationscopedsettingattribute(), _
="" global.system.diagnostics.debuggernonusercodeattribute(),="" global.system.configuration.specialsettingattribute(global.system.configuration.specialsetting.connectionstring)=""> _
Public Property Virus_Signature_Database_be___CopyConnectionString() As String
Get
Return CType(Me("Virus_Signature_Database_be___CopyConnectionString"), String)
End Get
Set(value As String)
End Set
End Property
Dale 2012
29-Jan-12 17:59pm
View
You are bang on the money with this but once I fix the section you say I get a new error white message:
Resource was of type 'Microsoft.VSDesigner.VSDesignerPackage.SerializableConnectionString' instead of String - call GetObject instead.
Please Help Im pulling my hair out over this thing.
thank you if you can and if you cant please let me know what else I can tell you to solve this issue.
Dale 2012
29-Jan-12 2:00am
View
can anyone please elaborate on this for me a bit more?
Dale 2012
29-Jan-12 0:21am
View
F1 brings me to MSDN but it is of no help
Dale 2012
29-Jan-12 0:19am
View
Ok well I am unsure where in the code the connection string may be because I did not write the code, it was added by the form when I added it with the binding source and then with data source to create my data set which has no error until I go to add the data member. could you inform me of where to look or how exactly to change the read only property?
Dale 2012
14-Jan-12 18:30pm
View
Deleted
I may have a bit of a better question for you if your able to help. I am trying to use olly debugger / disassembler in my project to output the results to a a simple listbox or textbox. How can I add the source files from other open source projects to my own?
thank you in advance
all license information will be kept I do not plan to change anything about olly debugger or to claim it as my own I only wish to be able to use it under the guidelines of the license in my program
Dale 2012
14-Jan-12 11:02am
View
OMG thank you so much !! :)
Dale 2012
7-Jan-12 7:27am
View
As I understand a null reference error is caused by passing a null value when a value is needed. I do not know why this is happening because as far as I can see all areas should be giving a value of some kind. form object meaning UI objects or static objects.... Can I please pass it to you to save the confusion of what I am trying to say you can see for yourself?
Dale 2012
7-Jan-12 6:48am
View
Ok its obvious that I do not know the correct terms to the words of my problem but what i mean by form objects is writing code to a actual button or actual listbox, textbox, ect. the line of code that checks for a virus is a Crypo service MD5 hash function in a module that is not here in the code. The line of code that compares the computer file hash to my text document is:
If M5hash.Contains(Chash) Then
ListBox2.Items.Add(fi.FullName)
End If
This is the reason I wish for someone to take a look at the project in full and not just the code I have posted. Thank you for your smart answer SAKryukov and no its not beyond me to use it except it gives me a null reference error on top of my problems....
Dale 2012
6-Jan-12 17:34pm
View
Deleted
Would it be possible to send you a copy of the project I have so far so that you can see what parts of the code are having the errors I am experiencing?..... At the moment it errors argument null exception value cannot be null?
line: If M5hash.Contains(Chash) Then
If you would be so kind to look at the project I will email it to you
thank you in advance
Dale 2012
6-Jan-12 16:46pm
View
Deleted
also when I use the strings as you have said I get a null reference error at line:
If text2.Contains(text1) Then
??
Dale 2012
6-Jan-12 16:22pm
View
Deleted
Thank you very much Mika for your response. I figured out what you meant after I posted my questions to you but in your updated answer you say itemlist.add(fi.fullname). Is itemlist supposed to be a string also? as before it was a listbox. I understand everything now that you have said except for the listbox object collection bit.... If you could clear that up for me in a short sample I could sure learn allot for it.
thank you for all your help
Dale 2012
5-Jan-12 22:40pm
View
Deleted
Ok if i understand correctly, your telling me that I can Dim textbox1 As string and Dim textbox2 as string and not as new textbox right?.... also I find it confusing to understand how to gather items into a collection rather than as i go?... The MSDN is a bit weak in this explanation.... I could sure benefit allot if you could give a little more insight as i am sure you are 100% correct
Id be very appreciative to know your response thank you for this
Dale 2012
4-Jan-12 2:48am
View
I have seemed to make it work thank you!!
Dale 2012
3-Jan-12 23:49pm
View
can you give an example of what you mean here...... where have I gone wrong with the code?....
Dale 2012
3-Jan-12 23:45pm
View
Ok if I understand what your asking about the run time of the list box, there is no actual error but all the same it does not compare with the text file I am using.
Dale 2012
30-Nov-11 16:31pm
View
Problem solved thank you eduard lu for the comment it made me think and in the end figured it to be a program version problem thank you
Dale 2012
30-Nov-11 16:30pm
View
There is really no error here I have figured out the problem and have resolved it thank you all
Dale 2012
28-Nov-11 10:34am
View
someone please help I have no idea what is wrong with this or even please give some pointers when using the iterator function so that I can learn
Dale 2012
28-Nov-11 4:16am
View
The problem is when adding the iterator word to the function (ex. Private Iterator Function _matches(ByVal path As String) As IEnumerable(Of FileInfo)
the _matches has no declaration and when I take out the word iterator then the yield property tells me that I need to add it to my function statement.
Dale 2012
20-Nov-11 11:10am
View
there is 7 issues most the same but a few that are not if you will be willing to look at it for 5mins or so Id be very appreciative to your efforts.
Dale 2012
20-Nov-11 11:09am
View
yes I am fairly sure that it is because It works fine in C# but has caused my nothing but grief with vb.net and other than the system.io.path suggestion there may be 2 more instances within my safenativehandling that also have errors.
Public Shared Function FindFirstFile(ByVal fileName As String, <[In](), Out()> ByVal findFileData As FindData) As SafeFindHandle
End Function
<[In](), Out()> says that it is undeclared. Seeing as it does fine in C# I am unsure what it's declaration is.
thank you for reading this.
Dale 2012
20-Nov-11 6:42am
View
I have done what you instructed and by changing path.combine to system.io.path.combine it removes the errors and the program loads but once I click search to filter it freezes and does nothing. No exception is thrown will you consider looking at the project in vb.net as i am lost?
thank you in advance for your response :)
Dale 2012
16-Nov-11 13:54pm
View
I appologise for not being a little more in depth with my question.
The code I am working on was C# so when I did the conversion to VB.Net the yield word was left behind in the converted code and "combine" had no VB.Net translation so it to was left behind as an error.
The line of code in question is:
Win32.SafeFindHandle handle = Win32.SafeNativeMethods.FindFirstFile(Path.Combine(path, "*"), findData);
C# Combine = string Path.Combine(string path1, string path2) 'Combines two path strings
Dale 2012
16-Nov-11 11:17am
View
Thank you very much for trying to help but I have fixed the error
this question is closed
Dale 2012
16-Nov-11 10:38am
View
The project I am converting to vb.net from C# is located @
http://www.codeproject.com/KB/recipes/BoyerMooreSearch.aspx?display=PrintAll
Dale 2012
16-Nov-11 10:35am
View
what do you propose I fix? or change then?
the items variable you are asking about refers to:
private items ()() as BMSearch.BMHashTable.BMHashItem
Dale 2012
16-Nov-11 9:15am
View
I am unsure of the index? :( where can i find that information in the stack trace?
Dale 2012
16-Nov-11 9:13am
View
Also the exception expression is:
Index was outside the bounds of the array.
Dale 2012
16-Nov-11 9:05am
View
Line 26 is in this function:
(<pre>)Public Function [Get](ByVal Key As Char) As Integer()
Dim HashedKey As Integer = 256
If Items(HashedKey) IsNot Nothing Then
' The most likely variant
If Items(HashedKey)(0).Key = Key Then
Return Items(HashedKey)(0).Shifts
End If
For i As Integer = 1 To Items(HashedKey).Length - 1
If Items(HashedKey)(i).Key = Key Then
Return Items(HashedKey)(i).Shifts
End If
Next i
End If
Return Nothing
End Function(<pre>)
Line 26 reads : If Items(HashedKey) IsNot Nothing Then
Dale 2012
14-Nov-11 21:28pm
View
THANK YOU SOOOOOOOO MUCH IT WORKS!!!!! yeah!!!
Dale 2012
14-Nov-11 18:17pm
View
Will you be willing to provide an Small solution or example to this?
Dale 2012
12-Nov-11 18:08pm
View
As I understand the getfiles method only returns one file extension. I am asking how to search for multiple file extensions by altering the code i have so far.
Dale 2012
12-Nov-11 5:18am
View
could you go a bit into detail about how to filter?
Dale 2012
14-Oct-11 5:43am
View
How is it that I can alter this code to search for multiple file extensions?
Dale 2012
6-Oct-11 2:27am
View
ok I have looked it over and I appologize for now seeing it but I have tried to use this code:
For Each file1 In Directory.GetFiles(dir(".exe"))
dir = string
Conversion from string ".exe" to type 'Integer' is not valid.
How do i overcome this error?
Dale 2012
5-Oct-11 23:57pm
View
This code simply lists the files from a directory to a listbox which is good except I am only interested with certian file extensions and not every file. Also I wish to not need a listbox. In short how can I select a drive from lets say a combobox and then have a recrusive call run through only the selected file extensions (ex...... .exe .com .sys .ini ect ect) and not the other files such as .txt or .iso
Dale 2012
5-Oct-11 17:11pm
View
Thank you guys very much I appricate this allot I have changed the code as mehdi has said and even thoe I think I have tried this before it works now!!!!! SO HAPPY thanks again
Cheers!!
Dale 2012
5-Oct-11 17:07pm
View
I am still unsure as to why its null and the name labelX12 was dimed as a string but overlooked renaming the variable
I have changed the labelx12 to dim computerhash as string but still i get a null exception? how can i check for a uninitialized variable?
Dale 2012
13-Sep-11 22:22pm
View
Ok I have tried the code and at first it seems error free until I try to debug it. Maybe you can see where I have went wrong?
Imports RaptorDB
Public Class Form1
Dim rap As RaptorDB.RaptorDB = RaptorDB.RaptorDB.Open("storage", 255, False, INDEXTYPE.HASH)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
rap.Set("A1", "123456789") ' to set like a dictionary
Dim val As String = ""
If rap.Get("A1", val) Then
TextBox1.Text = val
End If
End Sub
End Class
The error message I get is:
System.InvalidOperationException was unhandled
Message=An error occurred creating the form. See Exception.InnerException for details. The error is: Path cannot be the empty string or all whitespace.
Source=RaptorDatabase Test
StackTrace:
at RaptorDatabase_Test.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at RaptorDatabase_Test.My.MyProject.MyForms.get_Form1()
at RaptorDatabase_Test.My.MyApplication.OnCreateMainForm() in C:\Users\Admin\AppData\Local\Temporary Projects\RaptorDatabase Test\My Project\Application.Designer.vb:line 35
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at RaptorDatabase_Test.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.ArgumentException
Message=Path cannot be the empty string or all whitespace.
Source=mscorlib
StackTrace:
at System.IO.Directory.CreateDirectory(String path)
at RaptorDB.RaptorDB.Initialize(String filename, Byte maxkeysize, Boolean AllowDuplicateKeys, INDEXTYPE idxtype) in C:\Users\Admin\Desktop\Raptor Database\RaptorDB\RaptorDB.cs:line 234
at RaptorDB.RaptorDB..ctor(String Filename, Byte MaxKeysize, Boolean AllowDuplicateKeys, INDEXTYPE idxtype) in C:\Users\Admin\Desktop\Raptor Database\RaptorDB\RaptorDB.cs:line 20
at RaptorDB.RaptorDB.Open(String Filename, Byte MaxKeysize, Boolean AllowDuplicateKeys, INDEXTYPE idxtype) in C:\Users\Admin\Desktop\Raptor Database\RaptorDB\RaptorDB.cs:line 53
at RaptorDatabase_Test.Form1..ctor() in C:\Users\Admin\AppData\Local\Temporary Projects\RaptorDatabase Test\Form1.vb:line 3
InnerException:
An error occurred creating the form. See Exception.InnerException for details. The error is: Path cannot be the empty string or all whitespace.
Dale 2012
13-Sep-11 9:44am
View
Your a good man thank you!! I will try the corrected code you have supplied but one thing is still a bit off in your assumption for number 3. You give code for saving MD5 hash codes for file names when in fact my question was how to quickly add the contents of the text file into the database. My text document contains way to many MD5 hash codes to enter them one by one. Any ideas? thank you for everything you have taught me!!
Dale 2012
12-Sep-11 7:39am
View
This is the code I have so far with one error.
Imports RaptorDB
Public Class Form1
Dim rap As RaptorDB.RaptorDB = RaptorDB.RaptorDB.Open("storage", 255, False, INDEXTYPE.HASH)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
rap.Set("A1", My.Resources.Master_MD5_SIG) ' to set like a dictionary
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim val As String = rap.Get("A1") ' will show "value associated with key"
TextBox1.Text = val
End Sub
End Class
Dale 2012
12-Sep-11 6:30am
View
Your example is just what i needed and now it makes perfect sense as to whats going on. Thank you once again your example for number one works perfect as I have tested it but in your second example where it says
Dim val As String = rap.Get("somestringkey") ' to read like a dictionary, I get an error which reads. overload resolution failed because no accessible 'Get' accepts this number of arguments? any clue as to why I may be getting this error?
Dale 2012
9-Sep-11 18:02pm
View
It would only take less than five minutes I am sure to clarify what your code does and to do 4 things with the raptor database.
1. add the text file into the database
2. Sort the values by hash
3. Save the values from the text file to the database
4. read the values from the database to the program
are these functions not part of your program? if not what can I use in its place?.
Dale 2012
9-Sep-11 17:54pm
View
Would I be asking questions to answers I already know?
Show More