执行一个字符串 [英] Execute a String

查看:93
本文介绍了执行一个字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!


有没有办法执行字符串?

这意味着:

1.我的应用显示对话框我在其中写StartCounting

2.我的程序运行StartCounting sub

还有其他方式然后只使用case吗?

Hi!

Is there a way to execute a string?
That means:
1. My app shows dialog box where I write "StartCounting"
2. My program run StartCounting sub
Is there any other way then just using "case"?

推荐答案

StartCounting是你班级中的一种方法吗?


如果是这样的话:类似......


导入System.Reflection

....

dim myType = myObject.GetType()

dim myMethod as MethodInfo = myType.GetMethod(" StartCounting")

dim result as Object = myMethod.Invoke(myObject,new Object(){

....参数。 ..}或没什么)


" zurg" <つ***** @ wp.pl>在消息中写道

新闻:Ol ************** @ TK2MSFTNGP11.phx.gbl ...
Is StartCounting a method in a class of yours?

if so: something like...

imports System.Reflection
....
dim myType = myObject.GetType()
dim myMethod as MethodInfo = myType.GetMethod("StartCounting")
dim result as Object = myMethod.Invoke(myObject, new Object(){
....parameters...} or Nothing)

"zurg" <zu*****@wp.pl> wrote in message
news:Ol**************@TK2MSFTNGP11.phx.gbl...
嗨!

有没有办法执行字符串?
这意味着:
1.我的应用程序显示对话框,我写StartCounting
2.我的程序运行StartCounting sub
还有其他方法,然后只使用案例?
Hi!

Is there a way to execute a string?
That means:
1. My app shows dialog box where I write "StartCounting"
2. My program run StartCounting sub
Is there any other way then just using "case"?





拿一个看看这个
http://www.dotnet247 .com / 247referenc ... / 18 / 90485.aspx


" zurg" <つ***** @ wp.pl> schrieb im Newsbeitrag

新闻:Ol ************** @ TK2MSFTNGP11.phx.gbl ...

Take a look at this
http://www.dotnet247.com/247referenc.../18/90485.aspx


"zurg" <zu*****@wp.pl> schrieb im Newsbeitrag
news:Ol**************@TK2MSFTNGP11.phx.gbl...
嗨!

有没有办法执行字符串?
这意味着:
1.我的应用程序显示对话框,我写StartCounting
2.我的程序运行StartCounting sub
还有其他方法,只需使用case吗?
Hi!

Is there a way to execute a string?
That means:
1. My app shows dialog box where I write "StartCounting"
2. My program run StartCounting sub
Is there any other way then just using "case"?



*" zurg" <つ***** @ wp.pl> scripsit:
* "zurg" <zu*****@wp.pl> scripsit:
有没有办法执行字符串?
这意味着:
1.我的应用程序显示对话框,我写StartCounting
2。我的程序运行StartCounting sub
有没有其他方法然后只使用case?
Is there a way to execute a string?
That means:
1. My app shows dialog box where I write "StartCounting"
2. My program run StartCounting sub
Is there any other way then just using "case"?




样品:


< http://www.codeproject.com/useritems/evaluator.asp>

< http://www.codeproject.com/csharp/livecodedotnet.asp>


如果您有DevX帐户:


< http://www.devx.com/codemag/Article/10352/0/page/1> ;


-

Herfried K. Wagner [MVP]

< http://www.mvps.org/ dotnet>



Samples:

<http://www.codeproject.com/useritems/evaluator.asp>
<http://www.codeproject.com/csharp/livecodedotnet.asp>

If you have a DevX account:

<http://www.devx.com/codemag/Article/10352/0/page/1>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


这篇关于执行一个字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆