jwu1023
Member
Dear all,
I created a module and a form in Visual Studio.Net like following:
However, when I ran it in DOS like:
Result: nothing happen, the Form1 pops up showing sum = 0.
Do I miss anything or the way I passed the command line parameter is not right? Thanks for your help in advance.
jwu1023
I created a module and a form in Visual Studio.Net like following:
VB.NET:
Module Module1
Public sum AsInteger
PublicSub Main(ByVal args() AsString)
Dim sum AsInteger
For i AsInteger = 0 To UBound(args)
sum += CInt(args(i))
Console.WriteLine(args(i))
Next
System.Windows.Forms.Application.Run(New Form1)
EndSub
EndModule
VB.NET:
PublicClass Form1
Inherits System.Windows.Forms.Form
:
:
PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
TextBox1.Text = sum
EndSub
EndClass
C:\WinAPP2 10 20 30
Result: nothing happen, the Form1 pops up showing sum = 0.
Do I miss anything or the way I passed the command line parameter is not right? Thanks for your help in advance.
jwu1023
Last edited by a moderator: