如题,各位,小弟现在手上有一VB.NET项目,需要转成VB6,请问有没有这方面的工具或者资料.因为代码和窗体实在多,所以需要找这面的资料和工具,谢谢

解决方案 »

  1.   

    VB6转VB.net有工具,反过来是没有的。即使如此,也不提倡转换,转过来会有些问题。还是用VB6重写好,把VB6不支持的改过来即可,同时不要犯错误这样的错误:VB.net可以这样定义变量 dim a,b,c as long,a,b,c都是Long型,不要误认为VB6也是这样,在VB6定义中,只有C是Long型,a和b都是变体类型。
      

  2.   

    须要注意的是,vb.net程序中,恐怕有的是不能转的,比如:面向对象编程中关于类和继承的概念等。
      

  3.   

    如果能完全理解VB.Net代码,且又熟悉VB6.0,那么改写并不困难。
      

  4.   

    不理解,为什么从vb.net转vb?
      

  5.   

    VB6
      VB.NET 
    ----------------------------------------------------- 
    DoEvents  
      System.Windows.Forms.Application.DoEvents()  
    Command1.BackColor = vbRed  
      Command1.BackColor = System.Drawing.Color.Red 
       Command1.BackColor = System.Drawing.Color.FromARGB(&H80C0FF) 
    ComboBox1.AddItem "one"  
      ComboBox1.Items.Add("one")  
    Command1.BackColor = &H80C0FF  
      Command1.BackColor = System.Drawing.ColorTranslator.FromOle(&H80C0FF&)  
    Form1.Caption = "Sample"  
      Form1.DefInstance.Text = "Sample"  
    Form1.Top  
      Form1.DefInstance.Top  
    MsgBox "message", vbInformation, "title"  
      MsgBox("message", MsgBoxStyle.Information, "title")  
    Form1.Height = 3500  
      Form1.DefInstance.Height = VB6.TwipsToPixelsY(3500)  
    Set MyObject = Command1  
      MyObject = Command1  
    Text1.SetFocus  
      Text1.Focus()  
    Command1.ToolTipText = "click me"  
      ToolTip1.SetToolTip(Command1, "click me")  
    Dim objAbout As AboutForm  
      Dim objAbout As Pharfruminsain_AboutForm_v1r0.AboutForm  
    sPath = App.Path  
      sPath = Application.StartupPath
    Private Sub Form_Unload(Cancel As Integer)  
      Private Sub Form1_Closed(....) Handles MyBase.Closed  
    List1.RemoveItem (0)  
      ListBox1.Items.Remove(0)  
    Dim arOne(10) As String  
      Dim arOne As New ArrayList(10)  
    Print #1, "sample text"  
      PrintLine(1, "sample text")  
    Open "c:\myfile.txt" For Input As #1  
      FileOpen(1, "c:\myfile.txt", OpenMode.Input)  
    Line Input #1, sTemp  
      sTemp = LineInput(1)  
    VB6:
        s=App.Comments
    VB.Net:
        Imports System.Diagnostics
        Imports System.Reflection
        s=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).CommentsVB6:
        s=App.CompanyName
    VB.Net:
        Imports System.Diagnostics
        Imports System.Reflection
        s=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).CompanyName)VB6:
        s=App.EXEName
    VB.Net:
        Imports System.Reflection
        With New System.IO.FileInfo([Assembly].GetExecutingAssembly.Location)
          s=.Name.Substring(0, .Name.Length - .Extension.Length)
        End With
      or
        s=System.AppDomain.CurrentDomain.FriendlyName
      Note: this includes the extension which would need to be parsed.VB6:
        s=App.FileDescription
    VB.Net:
        Imports System.Diagnostics
        Imports System.Reflection
        s=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).FileDescription)VB6:
        App.HelpFile
    VB.Net:
        No direct replacementVB6:
        i=App.hInstance
    VB.Net:
        Imports System.Runtime.InteropServices
        i=Marshal.GetHINSTANCE([Assembly].GetExecutingAssembly.GetModules()(0)).ToInt32VB6:
        s=App.LegalCopyright
    VB.Net:
        Imports System.Diagnostics
        Imports System.Reflection
        s=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).LegalCopyright)VB6:
        s=App.LegalTrades
    VB.Net:
        Imports System.Diagnostics
        Imports System.Reflection
        s=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).LegalTrades)VB6:
        App.LogMode
        App.LogPath
    VB.Net:
        No direct replacement; see the EventLog objectVB6:
        i=App.Major
    VB.Net:
        Imports System.Diagnostics
        Imports System.Reflection
        i=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).FileMajorPart)VB6:
        i=App.Minor
    VB.Net:
        Imports System.Diagnostics
        Imports System.Reflection
        i=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).FileMinorPart)VB6:
        App.NonModalAllowed
    VB.Net:
        No replacementVB6:
        App.OleRequestPendingMsgText
        App.OleRequestPendingMsgTitle
        App.OleRequestPendingTimeout
        App.OleServerBusyMsgText
        App.OleServerBusyMsgTitle
        App.OleServerBusyRaiseError
        App.OleServerBusyTimeout
    VB.Net:
        No replacement; OLE automation not supportedVB6:
        s=App.Path
    VB.Net:
        s=System.Windows.Forms.Application.StartupPath
      or
        Imports System.Reflecti 
      

  6.   

    既然中移动的飞信有把c#转为vc的需求,为啥把vb.net转为vb6的就那么不可思议呢:)