|
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.
|
|
|
|
|
Hi Dave,
I just finished this[^] test app using VS C# 2008 Express; with the InitializeComponent() stuff inside the main file, all works well, the designer locates and keeps updating its code just like older VS versions used to do.
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.
|
|
|
|
|
Cool. I never tried in in 2008. I don't have it installed anywhere at work yet.
|
|
|
|
|
Interesting!
I spend a fair amount of time doing the opposite, converting .Net 1.0/1.1 code to have a designer.cs file, since I prefer that.
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.”
|
|
|
|