从Visual Studio到命令行编程的Vb.Net代码 [英] Vb.Net code from visual studio to Command line programming

查看:98
本文介绍了从Visual Studio到命令行编程的Vb.Net代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



这是场景.

1)我有一台装有Visual Studio .Net的计算机(A)和一台没有Studio但已安装.NET框架的计算机(B).
2)在计算机A 上:我开发了一种表格,可以将数据从 Db1.table1 传输到 Db2.Table2 .对其进行了编译,并具有可执行文件EXE1.
3)此 EXE1 计算机B 上按预期运行正常.

我的问题是:
1)如果要(小的)更改数据库中字段名称更改的代码,我需要返回到 ComputerA ,更改代码,编译并制作 EXE 并将其部署在 ComputerB 上.

我如何避免将代码带到计算机A 以便Visual Studio更新它.可以使用.VB文件代码或其他文件自行更改计算机B 上的字段名称,并可以使用VBC(命令行编译器)生成 EXE 计算机B 本身上.

请为我的问题提供可能的解决方案


谢谢,
Kumar

Hi,

This is the scenario.

1) I have a computer (A) that has Visual Studio .Net and a Computer(B) that doesn''t have Studio but had .NET framework installed.
2) On Computer A : I developed a form which transfer data from Db1.table1 to Db2.Table2. Compiled it and had executable EXE1.
3) This EXE1 is running fine on Computer B as expected.

My problem is:
1) If want to (small)change the code for a Field name change in the database, i need to come back to ComputerA,change the code,compile and make EXE and deploy it on ComputerB.

How can i avoid to bring the code to Computer A for visual studio to update it. Can''t i make use of .VB file code or other files to change the field name on Computer B it self and make use of VBC (Command line compiler) to generate EXE on Computer B itself.

Please advice the possible solutions for my problem


Thanks,
Kumar

推荐答案

您可以,但是为您的VB程序提供一个命令行参数来决定要更改的名称会不会更简单?这样您就无需编译任何东西,只需运行带有新参数的经过测试的相同软件即可.

"是.如果我有一个或两个或任何其他预期的更改,这将是最佳解决方案.我通过示例解释了字段名称更改的问题.在很多情况下,我还有很多其他更改要做msgbox文本,而循环计数器更改,计时器控制秒数更改等....
请提供在不使用Visual Studio并使用VBC或CSC进行编译的情况下,建议使用代码进行更新和更新代码的方式
谢谢
"

如果您真的想这样做(并且我会尽量避免这样做,谁知道您的用户开始使用源代码,他们会破坏什么),请查看MSDN:
You could, but wouldn''t it be simpler to have a command line parameter to you VB program that decided which names to change? Then you wouldn''t have to compile anything, just run the same, tested software with new parameters.

"Yes.It would be best solution if i have one or two or any other expected changes. I explained the problem with the example, change in field name. I have lot of other changes to do in lot of cases, changing msgbox text, while loop counter changes,timer control seconds changes etc....
Please advice the way to update make use of the code and update the code without visual studio and compile with VBC or CSC
THanks
"

If you really want to do this (and I would try to avoid it, who knows what your users will manage to ruin if they start playing with the source code) then look at MSDN: Building from the Command Line (Visual Basic)[^] which will guide you through the process.

You may find that VBC is not included with the .NET framework, just VS. CSC (C# equivalent) is though, so you may have to use that instead.


嗨Kumar,

您可以考虑阅读单击一次"部署:

http://msdn.microsoft.com/en-us/library/t71a733d(VS .80).aspx


这将使您的客户可以从任一
自动更新 Web服务器或LAN共享.您仍然需要在
上进行更改 计算机 A ,但是在发布更改后,所有计算机
安装该程序的人将能够更新自己.

它可能无法满足您的特殊需求,但是绝对值得一看.


干杯


曼弗雷德(Manfred)
Hi Kumar,

you might consider reading up on "Click once" deployment:

http://msdn.microsoft.com/en-us/library/t71a733d(VS.80).aspx


This will enable your clients to automagically update from either a
webserver or a LAN share. You''d still have to do your changes on
computer A, but after the changes are published all computers
that installed the program will be able to update themselfes.

It may not fit your special needs, but it''s definitely worth a look.


Cheers


Manfred


这篇关于从Visual Studio到命令行编程的Vb.Net代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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