如何将VB.NET降级为VB6或将VB.NET更改为VB6 [英] How to downgrade the VB.NET to VB6 or change VB.NET to VB6

查看:72
本文介绍了如何将VB.NET降级为VB6或将VB.NET更改为VB6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了一个编码,用于将文件从桌面复制到可移动设备。但它在VB.net和Windows 7中运行。我们的大多数PC都是Windows XP。你能否告诉我如何将编码降级到能够在Windows XP上运行的VB6。



我尝试了什么:



I got an coding like which is used to copy files from desktop to Removable device. But it is working in VB.net and windows 7. Most of our PCs are windows XP. Can you please tell me how to downgrade the coding to VB6 which is able to run on windows XP also.

What I have tried:

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim Gig As Long = 1073741824L
        Dim FolderToCopy As String = My.Computer.FileSystem.SpecialDirectories.Desktop

        Try
            For Each Drive As IO.DriveInfo In IO.DriveInfo.GetDrives
                Select Case True
                    Case Not Drive.DriveType = IO.DriveType.Removable
                    Case Not Drive.IsReady
                    Case Not Drive.AvailableFreeSpace >= 2 * Gig
                    Case Else
                        Debug.Print("Copying {0} to {1}", FolderToCopy, Drive.RootDirectory.FullName)
                        My.Computer.FileSystem.CopyDirectory(FolderToCopy, Drive.RootDirectory.FullName, True)

                        ' Only do the copy once to first appropriate drive
                        Exit For
                End Select
            Next
        Catch ex As Exception
            Debug.Print(ex.ToString)
        End Try

    End Sub
End  class 

推荐答案

VB6与.NET不太相似 - 尽管你可以直接使用一些VB6代码.NET应用程序,反之则不然:您可以在VB6应用程序中使用 .NET特定代码。

您可能需要在VB6中重写您的新代码,使用软件作为模板来指导您,或者在XP机器上安装.NET。

.NET V4可以安装在XP机器上:在Windows XP上安装.NET Framework 4 .NET博客 [ ^ ]因此,如果您将软件定位到V4或更低版本,您可以直接运行更现代的软件而无需更改(前提是它是为x86构建的,或者您运行的是64位版本的XP)
VB6 is not that similar to .NET - although you can use some VB6 code directly in a .NET application, the reverse is not true: you can use NO .NET specific code in a VB6 application.
You would either have to rewrite your newer code in VB6, using the software as a "template" to guide you, or install .NET on XP machines.
.NET V4 can be installed on XP machines: Installing the .NET Framework 4 on Windows XP | .NET Blog[^] so if you target your software to V4 or below, you can run the more mordern software directly without change (provided that it's built for x86 or you are running an 64 bit version of XP)


这篇关于如何将VB.NET降级为VB6或将VB.NET更改为VB6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆