
正文
c转vb.net项目 vba转vbnet autocad
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
c语言怎么转化为vb语言
1、第一新建一个project。
2、输入头文件#include。
3、输入主函数int main()。
4、接着输入函数主体部分c转vb.net项目,变量必须先定义类型再使用。
5、输入变量c转vb.net项目的值c转vb.net项目,注意这里scanf里变量名前必须加,结尾必须加分号。
6、输入函数主体部分并输出。
7、点击编译按钮,查看是否有error。
8、接着直接运行,如此便转换c转vb.net项目了。
相关问答
Q1: 如何把下面的C#代码转换为VB.NET或者加个注解,新手看不明白?
Dim obj = file15.GetThumbnail2(version)
Dim imgPreview As System.Drawing.Image = PictureDispConverter.Convert(obj)
imgPreview.Save("C:\temp\123456.bmp", System.Drawing.Imaging.ImageFormat.Bmp)
imgPreview.Dispose()
Public Class PictureDispConverter
Inherits AxHost
Public Sub New()
MyBase.New("56174C86-1546-4778-8EE6-B6AC606875E7")
End Sub
Public Shared Function Convert(ByVal objIDispImage As Object) As System.Drawing.Image
Dim objPicture As System.Drawing.Image = Nothing
objPicture = CType(System.Windows.Forms.AxHost.GetPictureFromIPicture(objIDispImage), System.Drawing.Image)
Return objPicture
End Function
End Class
Q2: 怎样把VC++代码转换成VB代码
1.定义量
我首先看第例:
#define STD_COPY1//COMMCTRL.H
VC++代码用#define定义量,VB用Const定义,转换VB代码:
Public ConstSTD_COPY=1
第二例:
#define LB_SELECTSTRING0x018C//WINUSER.h
问题,VC++所"0x"值十六进制,VB表示十六进制要用"H".转换VB代码:
Const LB_SELECTSTRING=0x018C
Q3: C# to vb.net 代码转换
System.Runtime.InteropServices.DllImport("user32.dll") _
Public Shared Function SetWindowLong(hWnd As IntPtr, nIndex As Integer, wndproc As Integer) As Integer
End Function
System.Runtime.InteropServices.DllImport("user32.dll") _
Public Shared Function GetWindowLong(hWnd As IntPtr, nIndex As Integer) As Integer
End Function
Public Const GWL_STYLE As Integer = -16
Public Const WS_DISABLED As Integer = H8000000
Public Shared Sub SetControlEnabled(c As Control, enabled As Boolean)
If enabled Then
SetWindowLong(c.Handle, GWL_STYLE, (Not WS_DISABLED) And GetWindowLong(c.Handle, GWL_STYLE))
Else
SetWindowLong(c.Handle, GWL_STYLE, WS_DISABLED + GetWindowLong(c.Handle, GWL_STYLE))
End If
End Sub
授人以渔c转vb.net项目:
这个网站超牛逼
Q4: C语言转换为VB.NET
Option Explicit On
Option Strict On
Imports System
Module Program
Sub Main()
Dim y,m,t As Integer
begin:
' 输入数据时一行一个
y=CInt(Console.ReadLine())
m=CInt(Console.ReadLine())
t=CInt(Console.ReadLine())
If y
200 Then
Console.WriteLine("ERROR")
goto begin
End If
pr(y,m,t)
Console.Write("Press any key to continue . . . ")
Console.ReadKey(True)
End Sub
Function pr(y As Integer,m As Integer,t As Integer) As Integer
Dim ye,[Me],i As Integer
ye=CInt((m+t-2)/12+y)
[Me]=(m+t-2) Mod 12+1
End If
End Function
Function mday(y As Integer,m As Integer) As Integer
Dim day As Integer()={0,31,28,31,30,31,30,31,31,30,31,30,31}
Dim ad As I
Q5: .net把C#转为VB代码
我这个就是VB.NET的代码
Imports System
Imports System.Reflection
Imports System.Runtime.Serialization
Imports System.Runtime.Serialization.Formatters
Imports System.Runtime.Serialization.Formatters.Binary
Imports System.Runtime.CompilerServices
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.Tcp
Imports System.Runtime.Remoting.Messaging
Namespace Learn.Library.Remoting
Public Class RemotingTest ' *'// summary
' '/ 远程类型
' '/ /summary
' Public class Data : MarshalByRefObject
' {
' private Integer i
'
' Public Integer I
' {
' get
' {
' Return i
' }
'
' set
' {
' i = value
' }
'
' }
'
' Public void Where()
' {
' Console.WriteLine("{0} in {1}", Me.GetType().Name, AppDomain.CurrentDomain.FriendlyName)
' }
' }
'
' /**'// summary
' '/ 服务器端代码
' '/ /summary
' static void Server()
' {
' ' 创建新的应用程序域,以便模拟分布系统。
' AppDomain server = AppDomain.CreateDomain("server")
' server.DoCallBack(delegate
' {
' ' 创建并注册信道
' TcpServerChannel channel = New TcpServerChannel(801)
' ChannelServices.RegisterChannel(channel, False)
'
' ' 注册远程对象激活模式
' RemotingConfiguration.RegisterWellKnownServiceType(Type.GetType(Data), "data",
' WellKnownObjectMode.Singleton)
'
' }
' )
' }
'
' /**'// summary
' '/ 客户端代码
' '/ /summary
' static void Client()
' {
' ' 创建并注册信道
' TcpClientChannel channel = New TcpClientChannel()
' ChannelServices.RegisterChannel(channel, False)
'
' ' 创建远程对象并调用其方法
' Data data = CType(Activator.GetObject(Type.GetType(Data), "tcp://localhost:801/data"), Data)
' data.Where()
'
' ' 判断是否是代理
' Console.WriteLine(RemotingServices.IsTransparentProxy(data))
' }
'
' static void Main()
' {
' Server()
' Client()
' }
' }
'
End Class
{ ' *'// summary
' '/ 远程类型
' '/ /summary
' Public class Data : MarshalByRefObject
' {
' private Integer i
'
' Public Integer I
' {
' get
' {
' Return i
' }
'
' set
' {
' i = value
' }
'
' }
'
' Public void Where()
' {
' Console.WriteLine("{0} in {1}", Me.GetType().Name, AppDomain.CurrentDomain.FriendlyName)
' }
' }
'
' /**'// summary
' '/ 服务器端代码
' '/ /summary
' static void Server()
' {
' ' 创建新的应用程序域,以便模拟分布系统。
' AppDomain server = AppDomain.CreateDomain("server")
' server.DoCallBack(delegate
' {
' ' 创建并注册信道
' TcpServerChannel channel = New TcpServerChannel(801)
' ChannelServices.RegisterChannel(channel, False)
'
' ' 注册远程对象激活模式
' RemotingConfiguration.RegisterWellKnownServiceType(Type.GetType(Data), "data",
' WellKnownObjectMode.Singleton)
'
' }
' )
' }
'
' /**'// summary
' '/ 客户端代码
' '/ /summary
' static void Client()
' {
' ' 创建并注册信道
' TcpClientChannel channel = New TcpClientChannel()
' ChannelServices.RegisterChannel(channel, False)
'
' ' 创建远程对象并调用其方法
' Data data = CType(Activator.GetObject(Type.GetType(Data), "tcp://localhost:801/data"), Data)
' data.Where()
'
' ' 判断是否是代理
' Console.WriteLine(RemotingServices.IsTransparentProxy(data))
' }
'
' static void Main()
' {
' Server()
' Client()
' }
' }
'
End Namespace
{
Public Class RemotingTest ' *'// summary
' '/ 远程类型
' '/ /summary
' Public class Data : MarshalByRefObject
' {
' private Integer i
'
' Public Integer I
' {
' get
' {
' Return i
' }
'
' set
' {
' i = value
' }
'
' }
'
' Public void Where()
' {
' Console.WriteLine("{0} in {1}", Me.GetType().Name, AppDomain.CurrentDomain.FriendlyName)
' }
' }
'
' /**'// summary
' '/ 服务器端代码
' '/ /summary
' static void Server()
' {
' ' 创建新的应用程序域,以便模拟分布系统。
' AppDomain server = AppDomain.CreateDomain("server")
' server.DoCallBack(delegate
' {
' ' 创建并注册信道
' TcpServerChannel channel = New TcpServerChannel(801)
' ChannelServices.RegisterChannel(channel, False)
'
' ' 注册远程对象激活模式
' RemotingConfiguration.RegisterWellKnownServiceType(Type.GetType(Data), "data",
' WellKnownObjectMode.Singleton)
'
' }
' )
' }
'
' /**'// summary
' '/ 客户端代码
' '/ /summary
' static void Client()
' {
' ' 创建并注册信道
' TcpClientChannel channel = New TcpClientChannel()
' ChannelServices.RegisterChannel(channel, False)
'
' ' 创建远程对象并调用其方法
' Data data = CType(Activator.GetObject(Type.GetType(Data), "tcp://localhost:801/data"), Data)
' data.Where()
'
' ' 判断是否是代理
' Console.WriteLine(RemotingServices.IsTransparentProxy(data))
' }
'
' static void Main()
' {
' Server()
' Client()
' }
' }
'
End Class
{ ' *'// summary
' '/ 远程类型
' '/ /summary
' Public class Data : MarshalByRefObject
' {
' private Integer i
'
' Public Integer I
' {
' get
' {
' Return i
' }
'
' set
' {
' i = value
' }
'
' }
'
' Public void Where()
' {
' Console.WriteLine("{0} in {1}", Me.GetType().Name, AppDomain.CurrentDomain.FriendlyName)
' }
' }
'
' /**'// summary
' '/ 服务器端代码
' '/ /summary
' static void Server()
' {
' ' 创建新的应用程序域,以便模拟分布系统。
' AppDomain server = AppDomain.CreateDomain("server")
' server.DoCallBack(delegate
' {
' ' 创建并注册信道
' TcpServerChannel channel = New TcpServerChannel(801)
' ChannelServices.RegisterChannel(channel, False)
'
' ' 注册远程对象激活模式
' RemotingConfiguration.RegisterWellKnownServiceType(Type.GetType(Data), "data",
' WellKnownObjectMode.Singleton)
'
' }
' )
' }
'
' /**'// summary
' '/ 客户端代码
' '/ /summary
' static void Client()
' {
' ' 创建并注册信道
' TcpClientChannel channel = New TcpClientChannel()
' ChannelServices.RegisterChannel(channel, False)
'
' ' 创建远程对象并调用其方法
' Data data = CType(Activator.GetObject(Type.GetType(Data), "tcp://localhost:801/data"), Data)
' data.Where()
'
' ' 判断是否是代理
' Console.WriteLine(RemotingServices.IsTransparentProxy(data))
' }
'
' static void Main()
' {
' Server()
' Client()
' }
' }
' }
'
'
'
'
'
c转vb.net项目的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于vba转vbnet autocad、c转vb.net项目的信息别忘了在本站进行查找喔。







