【发布时间】:2012-02-01 06:44:18
【问题描述】:
我正在尝试将 VB.NET 项目转换为 C#。 我正在根据需要转换所有表单和类,但我不知道我需要在哪里编写 ApplicationEvents.vb 中的事件(我相信它是从属性自动生成的)
这是我的 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
此外,我们将不胜感激任何可能有助于此转换的提示。 谢谢!
【问题讨论】:
标签: c# vb.net vb.net-to-c#