- UID
- 390967
- 帖子
- 1185
- 主題
- 620
- 精華
- 0
- 積分
- 765
- 楓幣
- 6874
- 威望
- 308
- 存款
- 4100
- 贊助金額
- 1800
- 推廣
- 0
- GP
- 1622
- 閱讀權限
- 150
- 在線時間
- 142 小時
- 註冊時間
- 2023-5-18
- 最後登入
- 2024-4-28
|
這個例子使用反射方法達成- string sExeFile = @"C:\windows\notepad.exe";
- Assembly assebly = Assembly.LoadFrom(sExeFile);
- Module module = assebly.ManifestModule;
- Type[] types = module.GetTypes();
- Type tpForm = typeof(Form);
- foreach (Type type in types)
- {
- if (type.IsSubclassOf(tpForm))
- {
- MessageBox.Show(type.FullName);
- }
- }
複製代碼 |
|