سلام
آخه کدی بجز کد پست 7 ندارد!!! چی باید اضافه کنم.
اگر Sub Main را تنظیم کنید این کد یک برنامه کامل است و فرم هم نمایش میدهد:
این هم همین کد به صورت برنامه:کد:Public Class Class1
Inherits System.Windows.Forms.Form
Private m_Label As New System.Windows.Forms.TextBox
Public Sub New()
Me.m_Label.Dock = System.Windows.Forms.DockStyle.Top
Me.Controls.Add(Me.m_Label)
End Sub
Public Sub SetFilePath(ByVal path As String)
Me.m_Label.Text = path
End Sub
<STAThread()> Public Shared Sub Main(ByVal args() As String)
Dim filename As String = Nothing
If (args IsNot Nothing) Then
For Each arg As String In args
If (arg Is Nothing) OrElse (arg.Length <= 1) Then Continue For
If (arg(0) <> """"c) Then
filename = arg
Exit For
End If
If (arg.Length > 4) Then
filename = arg.Substring(1, arg.Length - 2)
Exit For
End If
Next
End If
'--------------
System.Windows.Forms.Application.EnableVisualStyles()
System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(False)
Dim f As New Class1()
f.SetFilePath(filename)
System.Windows.Forms.Application.Run(f)
End Sub
End Class
rapidshare.com/files/274611900/WindowsApplication2.zip
اگر فایلی روی exe این برنامه در شاخه bin رها کنید، نام فایل را تشخیص داده و نشان میدهد.
موفق باشید.