|
Good morning Journey,
Thanks for taking care of my problem. I havn't check your code yet because I'm a little bit tired for spending my nights in front of the computer. I find another solution with the ATTRIBUTE Class. It's works too. I will check your code next week because my leave starts.
If you can find a hidden problem in my code please tell.
Public Function BrowseForMediaFiles(ByRef AL_MediaFileAndPath As ArrayList, ByVal selectedPath As String, ByVal exTensions() As String) As ArrayList
Dim dic As New IO.DirectoryInfo(selectedPath)
Dim AtrrDir As Object
For Each Filter As String In exTensions
For Each fname As String In System.IO.Directory.GetFiles(selectedPath, "*." + Filter, IO.SearchOption.TopDirectoryOnly)
AL_MediaFileAndPath.Add(fname)
Next fname
Next Filter
For Each dirc As IO.DirectoryInfo In dic.GetDirectories()
AtrrDir = dirc.Attributes 'Determine directory attribut.
Select Case AtrrDir
Case 22, 8214
'AtrrDir=22 The directory is a system directory. The directory is part
'of the operating system or used exclusively by the operating system
Case Else
For Each Filter As String In exTensions
For Each fname As String In System.IO.Directory.GetFiles(dirc.FullName, "*." + Filter, IO.SearchOption.AllDirectories)
AL_MediaFileAndPath.Add(fname)
Next fname
Next Filter
End Select
Next dirc
Return AL_MediaFileAndPath
End Function 'BrowseForMediaFiles
|
|
|
|
|
Beim Lauf durch die Verzeichnisse greift das Programm u.a. auf das Verzeichnis
"C:\System Volume Information" zu. Der Zugriff wird dann verweigert und es wird eine Fehlermeldung zurück gegeben.
Wie kann ich diese Meldung Abfangen (TRY) bzw. vermeiden mit Attribute ?
Bei Abfangen mit Try wird die Schleife nicht weiter durchlaufen.
Bei Vermeidung des Fehlers mit ATTRIBUTE weis ich nicht wie und wo ich diese Abfrage einbeuen muß.
Mein Code :
Private Function FindFiles(ByRef FoundFiles As ArrayList, ByVal dirname As String, ByVal filespec As String, ByVal recurseDirs As Boolean) As ArrayList
Dim strFilter As String = filespec
Dim m_arExt() As String = strFilter.Split(";")
Dim dic As New IO.DirectoryInfo(dirname)
For Each Filter As String In m_arExt
For Each fname As String In System.IO.Directory.GetFiles(dirname, Filter)
FoundFiles.Add(fname)
Next fname
' recurse on subdirectory if so requested
If recurseDirs Then
For Each dname As String In System.IO.Directory.GetDirectories(dirname)
FindFiles(FoundFiles, dname, filespec, recurseDirs)
Next dname
End If
Next Filter
Return FoundFiles
End Function
kann mir jemand weiter helfen ?
Gruß Theo
|
|
|
|
|
You'll find more help if you can translate this into English.
To actually recurse, you need to write a recursive function, this will only work to one level.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hiya,
I'm trying to import some data from a text file. Its delimited by a carriage return.
I've tried
myRow(i) = myLine.Split(vbcrlf)
and I've tried
myRow(i) = myLine.Split(Chr(13))
but Split just wont split it.
Any other ideas?
|
|
|
|
|
Read it a line at a time to start with ? Is this VB6 or VB.NET ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Its VB.net 1.1
And Sorry, I was trying to simplify the question as much as possible and may have mislead away from the problem.
Its a string, not a file, that has been generated by a stream from a httpWebResponse.
Therefore its one string full of data that is delimited by a line feed.
I'm trying to break that string up into an array for each record.
|
|
|
|
|
If splitting on Environment.NewLine does not work, then you should look at the string in memory using the debugger and work out what delimiter to use.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Whenever I used XP Button(Flat style->system) in vb.net appls with an icon or image,the image or icon is not shown... But this does if I select flat style->standard or others except system....Is there any another method, becouse I've seen some XP Buttons containing image or icon, eg. in the following link(nero burning appls)
click here
|
|
|
|
|
|
hi
i have a vb 5.0 program for a camera which orders the camera to zoom in and out and move left, right etc..
how can i upgrade a program which is in vb 5.0 to vb 6.0.
i have the source code and what do i do?
thanking you
|
|
|
|
|
I can't remember if VB6 has an Upgrade wizard or not. I don't remember seeing one. That being said, I think your only option is to rewrite the code in a VB6 project.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
There is no upgrade wizard in vb6 like vb.net. But when you open your vb5 project in vb6 application, it will prompt you to convert your project to vb6 project. Then after it convert you will be able to coding your application in vb6 language. And when you try to open to open your covert project in vb5 it won't be able to open.
If you want to covert your code make sure that you backup your orginal project. Because some function might not work in vb6 that need you to rewrite it again.
|
|
|
|
|
Hi, can anyone give me some pointers here, I’m currently converting a MS Access project to VB.NET and I’m finding the data structures very slow to use, for example in VB.NET I’m creating a typed Dataset adding a query to it if needed and calling it like so:
Private dtNorskeImport As DBSGeeGroupLIVEDataSet1.tblNorskeImportDataTable<br />
Private drNorskeImport As DBSGeeGroupLIVEDataSet1.tblNorskeImportRow<br />
Private taNorskeImport As New DBSGeeGroupLIVEDataSet1TableAdapters.tblNorskeImportTableAdapter<br />
<br />
dtNorskeImport = taNorskeImport.GetDataByNull<br />
drNorskeImport = dtNorskeImport.Rows(0)<br />
drNorskeImport.Feild1 = 123<br />
taNorskeImport.Update(dtNorskeImport)
Is there a better way? Or Faster way?
-- modified at 12:02 Tuesday 7th February, 2006
|
|
|
|
|
What data structures? You've shown un a bunch of code that you wrote to call methods in your classes, but nothing that could be used to determine what could be so slow in those methods.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Sorry, the slow part is all the code that is required to do such a simple task.
|
|
|
|
|
Well that answer didn't help.
At this point, you're only options are to step through the debugger and see if there is a bottleneck somewhere or get your hands on a code profiler that times the execution of individual methods and even statements.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The fastest way to update data is to use a command object to run an sql query.
---
b { font-weight: normal; }
|
|
|
|
|
Hi guys, does anyone know where i can find the images in vb.net. I mean, the toolstrip has some common items and they come with images ass well as the bindingnavigator (next, previous...)
Does anyone know where i can find this pics or even better...Does anyone know of a good images library that i could get (FREE) somewhere on the internet
Plese post any links here so we can use some cool pics in our apps
images = icons, small images..U know what i mean
Thank You
Alexei
|
|
|
|
|
Not sure what your trying to accomplish here but I have been able to use all sorts of images (bitmaps, jpeg, gif....) in my apps. The only image that I'd like to see more support on is the Targa image.
|
|
|
|
|
I can't remember the path off the top of my head, but they're in \Program Files\Microsoft Visual Studio .NET\Common7. Ahhhh screw it, just search the Microsoft Visual Studio .NET folder for Common and you'll find the images in there.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Thanks a lot Roath Kanel, this is what i meant
Alexei AR
|
|
|
|
|
You are welcome
|
|
|
|
|
how to remove VBA help from references which is under tools. when i included my library, its calling VBA and my library. but i want only library to display
www.tamilselvan.zoomshare.com
|
|
|
|
|
If your component requires a reference to VBA, then your code using that component will automatically have the same reference. You can't turn it off.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|