|
OK fixed, thanks for the help.
It's now writing the not copied files to a log file and caries on with the process.
here is my code at the moment:
Imports System.IO
Imports System.Security.Permissions
Public Class frmProfileCopier
Dim SourcePath As String, DestPath As String, ExactPath As String
Dim attributeReader As System.IO.FileAttributes
Dim infoReader As System.IO.FileInfo
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click
SourcePath = "C:\Documents and Settings\" & tbUserName.Text & "\"
ExactPath = "UserData\" & tbUserName.Text & "\"
DestPath = fbdDestDrive.SelectedPath & "\" & ExactPath
CopyDirectory(SourcePath, DestPath)
MessageBox.Show("copy done. Please see the exclusions.log for files that couldn't be copied", "Profile Copier")
End Sub
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
End
End Sub
Public Function CopyDirectory(ByVal Src As String, ByVal Dest As String, Optional _
ByVal bQuiet As Boolean = False) As Boolean
Try
If Not Directory.Exists(Src) Then
Throw New DirectoryNotFoundException("The directory " & Src & " does not exists")
End If
If Directory.Exists(Dest) AndAlso Not bQuiet Then
If MessageBox.Show("directory " & Dest & " already exists." & vbCrLf & _
"If you continue, any files with the same name will be overwritten", _
"Continue?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, _
MessageBoxDefaultButton.Button2) = DialogResult.Cancel Then Exit Function
End If
'add Directory Seperator Character (\) for the string concatenation shown later
If Dest.Substring(Dest.Length - 1, 1) <> Path.DirectorySeparatorChar Then
Dest += Path.DirectorySeparatorChar
End If
If Not Directory.Exists(Dest) Then Directory.CreateDirectory(Dest)
Dim Files As String()
Files = Directory.GetFileSystemEntries(Src)
Dim element As String
For Each element In Files
If Directory.Exists(element) Then
'if the current FileSystemEntry is a directory,
'call this function recursively
CopyDirectory(element, Dest & Path.GetFileName(element), True)
Else
File.Copy(element, Dest & Path.GetFileName(element), True)
End If
Next
Catch ex As Exception
Dim writer As New StreamWriter(Label1.Text & "exclusions.log", True, System.Text.Encoding.ASCII)
writer.WriteLine(ex.Message)
writer.Close()
End Try
Return True
End Function
Private Sub btnDestDrive_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDestDrive.Click
fbdDestDrive.ShowDialog()
Label1.Text = fbdDestDrive.SelectedPath & "UserData\" & tbUserName.Text & "\"
End Sub
End Class
thanks again!
Greetzzz,
CornElvis
www.jackied.nl
|
|
|
|
|
to all, i just want to ask, how i supposed to draw a map/ road map in vb 2008?
any code related to this?
please kindly help me,
thanks
|
|
|
|
|
|
thanks for your information. hm, can i did a simulation using vb 2008?
|
|
|
|
|
Hi
I'm trying to open an external file, either a .pdf or .doc programmatically from VB. It seems that VB gets confused when there is a space character in the filename or path string.
The following works perfectly:
Process.Start ("acrord32", "C:\Manuals\UserManual.pdf")
and also
Process.Start ("C:\Program Files\Adobe\Reader 8.0\Reader\acrord32 " , "C:\Manuals\UserManual.pdf")
However, the following gives an error message that it cannot find the file.
Process.Start ("acrord32", "C:\Manuals\User Manual.pdf")
I've experimented a bit with multiple scenarios, including trying to open a file in word. It seems that VB accepts a path with a space character in starting a process (e.g. Adobe Reader), however it gets confused when sending the path and filename of the external file to open. In particular, when trying to open a word file, the filename is truncated at the point of the space character, e.g. the "User Manual.doc" becomes "User.doc". I've tried multiple walkarounds such as using %20, [ ], _11, etc without effect.
Any help appreciated...
|
|
|
|
|
Try double quoting the file name. The quotes in your code are not passed on, so you end up with C:\Manuals\User Manual.pdf rather than "C:\Manuals\User Manual.pdf" - if you see what I mean.
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I've tried double-quoting but doesn't work in VB.
I've solved my problem with the following reply. But thanks for the interest...
Aris
|
|
|
|
|
Roullakis wrote: I've tried double-quoting but doesn't work in VB.
Meaning that you don't know how to do it...
Process.Start ("C:\Program Files\Adobe\Reader 8.0\Reader\acrord32 " , """C:\Manuals\UserManual.pdf""")
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Roullakis wrote: I've solved my problem with the following reply.
That was what I was trying to explain - obviously not very well!
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Obviously not. I thought that you were trying to explain what I showed...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
For opening .pdf or .doc file you do not need to specify any application name, as your system should be able to automatically detect application which is registered to open these file types.
Use of a simple line as following will work for you –
System.Diagnostics.Process.Start("C:\Manuals\User Manual.pdf")
Note that above mentioned syntax will work even if file name has got spaces within it.
-Dave.
------------------------------------
http://www.componentone.com
------------------------------------
|
|
|
|
|
Thanks Dave, that works
|
|
|
|
|
Dear All,
Which is the best tool to develop an CHM model help program, which will take data from a backend database and display in a manner like history of business discussion among a group of personnels.
there should be some display picture for each personnel and their comment would be come as text, each personnels comment will be separated by some lines.
you could do the same using a picture box, or datagridview, or by a richtext box. but i'm bit confused which one would be the best or any other control is available in Vb.Net ?
your suggestions are appericable
Warun
|
|
|
|
|
Error while showing report
the error is
Data Field 'cmd_fee.SECTION' not Found
i have no knowlege about reports
when i see the code of report there is no code
Please help me
battan20@gmail.com
|
|
|
|
|
Amit Battan Ror wrote: i have no knowlege about reports
OK - then why are you trying to generate one ? I'm not even sure what you're using, but I am pretty sure that cmd_fee is supposed to have a data field called SECTION, and it does not.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Amit Battan Ror wrote:
Data Field 'cmd_fee.SECTION' not Found
What part of the error message doesn't make sense?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Within Datasource(whether it is a dataset or datatable or something other), which is supplied to Report, Does not contains this field . Check the query from which you get the Result.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Error occur in the line
rep_fees.Show
rep_fees is a report file
|
|
|
|
|
hi,
First of all check all the fields which you place on Report at design time. At run time, check whether all fields which is placed on report at design time,is present in data source ?
Can you post the code-Snippet so i can analysis properly which statement can cause error ?
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
How can I mass deploy our windows application (that adds information to our database) if there is no ODBC Driver on our clients PC? any suggestion on this? our database server is FileMaker(sucks!)
P.S. we have several clients all over the globe and we cannot just have them install an ODBC Driver.
In short how to have DSN less connection to FileMaker Database?
modified on Wednesday, July 9, 2008 4:25 AM
|
|
|
|
|
Why don't you add the ODBC driver setup to you own deployment?
|
|
|
|
|
yes i can do that but then i have to manually configure it one by one for the file DSN and like i said, this application will be deployed on several locations around the globe. if anybody can suggest away to create a DSN-less connection for filemaker 8, id appreciate that.
|
|
|
|
|
You simply have no alternative. Either the FileMake ODBC drivers are installed or you're not getting a connection to the database. It's that simple.
As for a DSN-less connection, you just have to get the connection string correct. You can find an example of connecting to a FileMaker server here[^]. No DSN required.
|
|
|
|
|
I am planning to actually include the ODBC Installer in our package but encountered another problem, we are using FileMaker 8.5 and I have read from "www.filemaker.com/downloads/documentation/fm8_converting_databases.pdf" that 'The Local Data Access Companion (LDAC) and the Remote Data Access Companion (RDAC) are no longer supported.' in, i think, versions lower than Filemaker 7. Any other suggestions?
|
|
|
|
|
jalandoonkNEWBIE wrote: Any other suggestions?
Yeah. Upgrade to a database engine that IS supported, like SQL Server, Oracle, or MySQL (free).
|
|
|
|