|
Yes, it needs to be by date. The center that is requesting the archive DVD uses our software to pull the files from our SQL DB. The program they use has a listing of job numbers, and of the files, and other information, but we do not allow them remote access to them as they are from 2003-2006, and our cutoff is 01-01-2007.
They will be able to search the disk for the files using windows search, and we have yet to come up with a standard naming convention, so our office manager (not too tech savy) wants them in folders by year, 2003; 2004; 2005...etc and then by month.
So I'm just going with what he wants, but moving and creating folders for 15000 files is too time consuming, so I just need an app to do it for me.
between u, me, and the fencepost, I dont care how they use the disk, I just need to job done. lol.
I appreciate everyone's input. I'll be working on this tonight to get it out in tomorrow's End of Day, so stay tuned as I might need help with the code. ty all!
|
|
|
|
|
OK. I'll keep first watch.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
modified on Thursday, August 13, 2009 4:12 PM
|
|
|
|
|
I created a few sample text files with the name
smith john -19850615.txt
just to see if the code would work...
now when I hit open on the open file dialog, it just sits there.
<br />
Imports System.IO<br />
Public Class Form1<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
OpenFileDialog1.ShowDialog()<br />
<br />
End Sub<br />
<br />
Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk<br />
Dim oldpath As String<br />
Dim length As Integer<br />
Dim year As String<br />
Dim month As String<br />
Dim newpath As String<br />
Dim start As Int32 'start of year in string<br />
Dim start2 As Int32 'start of month in string<br />
Dim start3 As Int32 'start of filename in string<br />
Dim newpathfull As String<br />
<br />
For Each S As String In OpenFileDialog1.FileNames<br />
'oldpath = S<br />
'gets length of filename<br />
length = S.Length<br />
'Pulls year from last 12 digits of filename<br />
start = length - 12<br />
year = S.Substring(start, 4)<br />
'Pulls the month from the filename<br />
start3 = length - 8<br />
start2 = S.LastIndexOf("\")<br />
month = S.Substring(start3, 2)<br />
newpath = "C:\PP\"<br />
newpathfull = year & "\" & month & "\" & S.Substring(start2 + 1)<br />
'checks for directory, if not there then creates it.<br />
If (Directory.Exists(newpath)) Then<br />
System.IO.File.Copy(S, newpath)<br />
Else<br />
System.IO.Directory.CreateDirectory(newpath & year)<br />
System.IO.Directory.CreateDirectory(newpath & year & month)<br />
End If<br />
Next<br />
<br />
<br />
<br />
End Sub<br />
End Class<br />
|
|
|
|
|
HERE IT IS!
I deserve a raise...
<br />
<br />
Imports System.IO<br />
Public Class Form1<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
OpenFileDialog1.ShowDialog()<br />
<br />
<br />
End Sub<br />
<br />
<br />
Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk<br />
<br />
Dim oldpath As String<br />
<br />
<br />
For Each S As String In OpenFileDialog1.FileNames<br />
Dim length As Integer<br />
Dim yearpath As String<br />
<br />
Dim monthpath As String<br />
Dim newpath As String<br />
Dim start As Int32 'start of yearpath in string<br />
Dim start2 As Int32 'start of monthpath in string<br />
Dim start3 As Int32 'start of filename in string<br />
Dim newpathfull As String<br />
<br />
Threading.Thread.Sleep(100)<br />
<br />
'gets length of filename<br />
length = S.Length<br />
'Pulls yearpath from last 12 digits of filename<br />
start = length - 12<br />
yearpath = S.Substring(start, 4)<br />
'Pulls the monthpath from the filename<br />
start3 = length - 8<br />
start2 = S.LastIndexOf("\")<br />
monthpath = S.Substring(start3, 2)<br />
'new destination path<br />
newpath = S.Substring(0, 3) & yearpath & "\" & monthpath & "\"<br />
newpathfull = newpath & S.Substring((start2 + 1))<br />
'checks for directory, if not there then creates it.<br />
If (Directory.Exists(newpath)) Then<br />
System.IO.File.Copy(S, newpathfull)<br />
Else<br />
System.IO.Directory.CreateDirectory(newpath)<br />
System.IO.File.Copy(S, newpathfull)<br />
End If<br />
<br />
Next<br />
<br />
<br />
<br />
<br />
<br />
End Sub<br />
End Class<br />
<br />
Thanks everyone for all your help!
|
|
|
|
|
|
There is no "event" as you call it. AFAIK, there's not even a callback. I think you would have to enumerate the windows in the taskbar, keep a list of them, then enumerate them again every so often to see if the list changes. When the list changes, the know an app has been launched or has quit. The problem with this is that an app can run and end inside of the time you have for a polling interval. You'd never know an app was launched.
|
|
|
|
|
Thanky for your advise but what about messages?
when i use spy++ i get a lot of messages such as tb_cout(something like that)
how an i get them?
|
|
|
|
|
Probably by implementing either a GetMsgProc[^] hook or a JournalRecordProc[^] hook. Neither of which can be implemented in managed code (VB.NET or C#).
|
|
|
|
|
I want to retrieve External ip of my computer without using whatismyip website. Is there any library in VB 2005 to retrieve external IP. Please help me as soon as possible.
Regards,
Abhay
|
|
|
|
|
|
Hi,
using one or more external web sites is the only way I really trust for this to work reliably.
Have a look here[^].
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
The only way it works reliably is if you use a website external to your network.
|
|
|
|
|
Hello Everybody,
I m running in a serious trouble.I had uninstalled Visual Studio(VB6)Enterprise Edition from my PC.And know when i run VB application its not executing due to loss of some dll's and ocx files .So anybody can please help me in find list of Dll and OCX files have been deleted when uninstalling VB6.Please help its a menace ?
Thanxs in Advance.....
Rizwan
|
|
|
|
|
That list is quite long, on the order of a few hundred files. Since it sounds like you never created installers for these applications, you're only real recourse is to reinstall Visual Studio 6. If you had created installers for these apps, you would just have to reinstall the apps, or run a Repair on .MSI installers, to replace the missing files.
|
|
|
|
|
Hi Dave Kreskowiak
Thanks for your urgent reply ,I have an installer in my application.And u r right i have to reinstall it when i delete my Visual Studio 6.I wanna get the list of dll and ocx files deleted when VB6 is uninstalled.So that i can just place them again so that know need to reinstall it once again.Can u provide any idea on it.Kindly reply ..?
Thanks
|
|
|
|
|
|
Firstly be aware that I have never used VB6.
However, all previous versions of VB (v2.0 - v4.0) that I have used, required the run-time redistribution pack to be loaded on machines using apps written in VB. Therefore you might want to look at Visual Basic 6.0 Runtime Redistributable[^] page on MSDN.
If I am way off base, please ignore this.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Henry Minute wrote: If I am way off base, ...
If you are still using VB4 you are a little off base, otherwise all is fine.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Not still using, although I still have the Disks for VB3.0 lying about somewhere in a glass case labelled "In case of emergency, throw away"
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Well, if the installer was written correctly, it should already have all the components it needs to run the app inside the installer. They should all be installed with the application. The only thing that would not be included would be the VB6 runtime. That's installed seperately.
|
|
|
|
|
Can we exclude designer.vb file in windows applications using Visual studio 2005?
|
|
|
|
|
The designer files are just code to create the form and it's controls and lay them out on the form. Why would you want to execute just that file?? To answer you're question, no, you can't execute just the code in that file. All the files for the form are compiled into a single object that has no idea it was created from multiple files.
|
|
|
|
|
He said "exclude", not "execute". (Or maybe he edited the post.)
|
|
|
|
|
Hi,
1. when you create another kind of project (say a Console app) you wouldn't get a designer file at all; you then can edit and add Windows.Forms code (or any other code) to the files you do get. That excludes designer support of course.
Also, you can copy-paste the designer code from where it is to where you prefer it to be, then remove the designer file. The designer may or may not still work for you then (I do it sometimes in C#, I have no experience doing this in VB.NET).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Luc Pattyn wrote: Also, you can copy-paste the designer code from where it is to where you prefer it to be, then remove the designer file. The designer may or may not still work for you then (I do it sometimes in C#, I have no experience doing this in VB.NET).
The last time I tried this, it broke the designer. Though, I can't rememer if it was VS2003 or VS2005.
|
|
|
|