相关疑难解决方法(0)

将项目转换为C#时,在哪里编写ApplicationEvents.vb的函数

我试图将VB.NET项目转换为C#.我按要求传递所有表单和类,但我不知道从ApplicationEvents.vb中编写事件需要从哪里开始(我相信它的属性是autoGenerated)

这是我的ApplicationEvent.vb文件中的代码:

Imports GM.Powertrain.RemoteCopy.Interfaces
Imports System.Runtime.Remoting.Channels.Tcp
Imports System.Runtime.Remoting.Channels

Namespace My
   Partial Friend Class MyApplication
      Private Shared serviceConfig As ServiceConfig =
         serviceConfig.Load()

      Protected Overrides Function OnStartup(
            ByVal eventArgs As StartupEventArgs) As Boolean
         Dim channel As TcpChannel = New TcpChannel()
         ChannelServices.RegisterChannel(channel, False)
         Me.MainForm = New Computer_Network_MAIN_SCREEN()
         Return MyBase.OnStartup(eventArgs)
      End Function

      Public ReadOnly Property Config() As ServiceConfig
         Get
            Return serviceConfig
         End Get
      End Property

      Public ReadOnly Property LocalMachine() As IRemoteCopier
         Get
          Return serviceConfig.GetObject(Of IRemoteCopier)("localhost")
         End Get
      End Property
   End Class
End Namespace
Run Code Online (Sandbox Code Playgroud)

此外,任何可能有助于此转换的提示将不胜感激.谢谢!

c# vb.net vb.net-to-c#

1
推荐指数
1
解决办法
2786
查看次数

标签 统计

c# ×1

vb.net ×1

vb.net-to-c# ×1