mehdi.safavie
یک شنبه 01 شهریور 1394, 14:55 عصر
درود;
یه مشکل کوچیک دارم نمیدونم اشتباهم کجاست .
تو خود برنامه یه Class اضافه کردم و این کدش هست :
Public Class Line
Private mstrLine, mstrFileName As String
Property Line() As String
Get
Return mstrLine
End Get
Set(ByVal Value As String)
mstrLine = Value
End Set
End Property
ReadOnly Property Length() As Integer
Get
Return mstrLine.Length
End Get
End Property
WriteOnly Property FileName() As String
Set(ByVal Value As String)
mstrFileName = Value
End Set
End Property
Public Function GetWord() As String
Dim astrWords() As String
astrWords = Split(mstrLine, " ")
Return astrWords(0)
End Function
End Class
برای استفاده هم از این کد استفاده میکنم :
Dim oLine As New ClassLibrary1
oLine.Line = txtLine.Text
txtLength.Text = oLine.Length.ToString()
کار میکنه و هیچ مشکلی نداره
حالا جدای از این برنامه یه پروژه از نوع Class ساختم و همین کد های کلاس رو توش گذاشتم . از قسمت Build گزینه Buils solation رو هم زدم و فایل های Class ا (dll) اون ساخته شد .
حالا وقتی این کلاس رو از طریق Reference به یه پروژه جدید اضافه میکنم و اینطوری تعریفش میکنم اجرا نمیشه و این پیغام رو میده :
Imports InsertKama.InsertKama
اینم پیغامش :
Could not load type 'InsertKama.InsertKama' from assembly 'InsertKama, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
مشکل کارم کجاست ؟
یه مشکل کوچیک دارم نمیدونم اشتباهم کجاست .
تو خود برنامه یه Class اضافه کردم و این کدش هست :
Public Class Line
Private mstrLine, mstrFileName As String
Property Line() As String
Get
Return mstrLine
End Get
Set(ByVal Value As String)
mstrLine = Value
End Set
End Property
ReadOnly Property Length() As Integer
Get
Return mstrLine.Length
End Get
End Property
WriteOnly Property FileName() As String
Set(ByVal Value As String)
mstrFileName = Value
End Set
End Property
Public Function GetWord() As String
Dim astrWords() As String
astrWords = Split(mstrLine, " ")
Return astrWords(0)
End Function
End Class
برای استفاده هم از این کد استفاده میکنم :
Dim oLine As New ClassLibrary1
oLine.Line = txtLine.Text
txtLength.Text = oLine.Length.ToString()
کار میکنه و هیچ مشکلی نداره
حالا جدای از این برنامه یه پروژه از نوع Class ساختم و همین کد های کلاس رو توش گذاشتم . از قسمت Build گزینه Buils solation رو هم زدم و فایل های Class ا (dll) اون ساخته شد .
حالا وقتی این کلاس رو از طریق Reference به یه پروژه جدید اضافه میکنم و اینطوری تعریفش میکنم اجرا نمیشه و این پیغام رو میده :
Imports InsertKama.InsertKama
اینم پیغامش :
Could not load type 'InsertKama.InsertKama' from assembly 'InsertKama, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
مشکل کارم کجاست ؟