09-10-12, 05:12 PM
ترجمة عدة ملفات مصدرية باستخدام vbc.exe
تم إنشاء النسخة الحالية من التطبيق TestApp.exe بواسطة ملف *.vb وحيد والحقيقة هي أن معظم المشاريع تكون مؤلفة من عدة ملفات *.vb وذلك يبقي الكود أكثر مرونة وتنظيما وسنفترض أنه لديك فئة إضافية موجودة في الملف HelloMsg.vb ومحتويات الملف كانت كما يلي
كود :
Imports System
Imports System.Windows.Forms
Class HelloMessage
Sub Speak()
MessageBox.Show("Hello Again")
End sub
End classكود :
'A simple vb2008 appilication
Imports System
'Don't need This any More
'Imports system.Windows.Forms
Module TestApp
Sub Main()
Console.WriteLine("Testing! 1, 2, 3")
'Don't need This any More either
'MessageBox.Show("Hello!")
'Exercise the HelloMessage Class!
Dim hello as new HelloMessage()
hello.Speak()
End Sub
End Moduleكود :
vbc /r:System.Windows.Forms.dll TestApp.vb HelloMsg.vbكود :
vbc /r:System.Windows.Forms.dll *.vb