#副標=Visual Studio 2005新功能系列(13) #大標=Visual Studio 2005操作密技 #作者=文/沈炳宏 ===程式1 =========== myFile.rsp內容 /r:myAssembly.dll /r:myOtherAssembly.dll /nostdlib+ wincv @myFile.rsp ============= ==程式2 =========== Imports System.ComponentModel Public Class Class1 Inherits Component End Class ================ ==程式3 =========== #Const MySpecialCondition = True Class SomeClass _ public Sub SomeMethod() End Sub End Class Dim obj as SomeClass obj = new SomeClass() obj.SomeMethod() ================ ==程式4 =========== public class MyPublisher { EventHandler m_MyEvent; public event EventHandler MyEvent { add { m_MyEvent += value; } remove { m_MyEvent -= value; } } } ================ ==程式5 =========== Public Class MyPublisher   Event m_MyEvent As EventHandler   Public Custom Event MyEvent As EventHandler   AddHandler(ByVal value As EventHandler)   AddHandler m_MyEvent,value   End AddHandler   RemoveHandler(ByVal value As EventHandler)   RemoveHandler m_MyEvent,value   End RemoveHandler      RaiseEvent(ByVal sender As Object, ByVal ea As EventArgs)  RaiseEvent m_MyEvent(sender,ea)   End RaiseEvent End Event End Class ================ ==程式6 =========== Imports System.Threading Public Class Form1 Private Sub Button1_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim currentThread As Thread = Thread.CurrentThread Dim threadName As String = "執行緒1" currentThread.Name = threadName MessageBox.Show("測試執行緒") End Sub End Class ================