write .net code in vb 6 or deploy the code with complete setup  
Author Message
masoomsanadi





PostPosted: .NET Base Class Library, write .net code in vb 6 or deploy the code with complete setup Top

The code i used in VB .net to find a particular file on all the drives is at the bottom.

The problem is that when this executable file is to be executed on another pc ".net frame work" has to be installed on client computer, which i don't want.

I tried to re write this code in VB 6 but it shows many errors. I want the Vb 6 code.

Or if thre any other way i can run this executable file without any other framework installation. i would like to know.

Code in VB .net:

Public Class Form1

Private Sub fSearchDrives()
Dim saDrives() As System.IO.DriveInfo = System.IO.DriveInfo.GetDrives()
Dim sdrive As System.IO.DriveInfo
For Each sdrive In saDrives
Try
Me.fSearchFolders(sdrive.Name)
Catch ex As IO.IOException
Catch ex As UnauthorizedAccessException
End Try
Next
End Sub

Private Sub fSearchFolders(ByVal sRoot As String)
Dim saFolders() As String = System.IO.Directory.GetDirectories(sRoot)

For Each sCurrentFolder As String In saFolders
Me.fSearchFile(sCurrentFolder)
Next
End Sub

Private Sub fSearchFile(ByVal currentPath As String)
Dim saFilesFound() As String = System.IO.Directory.GetFiles(currentPath, "example.exe", System.IO.SearchOption.AllDirectories)
For Each sSearchedFile As String In saFilesFound
MsgBox(sSearchedFile)
Next
End Sub

Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
fSearchDrives()
End Sub
End Class




.NET Development36  
 
 
ahmedilyas





PostPosted: .NET Base Class Library, write .net code in vb 6 or deploy the code with complete setup Top

AFAIK you can't use VB6 and .NET assemblies, I could be wrong. Either way if you are going to be using a .NET component, you NEED the .NET Framework. There is no way out

For VB6 questions, please post here:

http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx dg=microsoft.public.vb.general.discussion&cat=en_us_ab067bc0-bda5-4921-a1ec-e76402873945&lang=en&cr=us