代码检查请... [英] Code check please...

查看:46
本文介绍了代码检查请...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

提前致谢:


昏暗此人(7)As Array

Dim validcheck As Boolean = False


thisperson = getperson(usernametextbox.Text,pinnumbertextbox.Text)

....


私函数getperson(byval username as string,byval pinnumber as

string)

....

dim returnarray(7)

....

返回returnarray


错误:在thisperson上抛出无效的强制转换异常= ...之后

执行函数...我在这里错过了什么????


谢谢!

Derek

解决方案

" Derek Martin" < DM ***** @ DONTSPAMMEokstate.edu>在消息新闻中写道:uv ************** @ TK2MSFTNGP09.phx.gbl ...

提前致谢:

昏暗thisperson(7)As Array
Dim validcheck As Boolean = False

thisperson = getperson(usernametextbox.Text,pinnumbertextbox.Text)
...

>私人函数getperson(byval用户名为字符串,byval pinnumber为
字符串)
...
dim returnarray(7)


如果这不是是Dim returnarray(7)As Array?

...

返回returnarray

错误:在thisperson =上抛出无效的强制转换异常。 ......之后
执行功能......我在这里缺少什么????

谢谢!
Derek



好吧,我跟着你说的话,实际上从

thisperson中删除了as数组,以获得:


昏暗的这个人(7)

然后

昏暗的返回(7)


同样的错误....

??? ?

Derek


" Al Reid" < AR ***** @ reidDASHhome.com>在消息中写道

news:%2 **************** @ tk2msftngp13.phx.gbl ...

"德里克·马丁 < DM ***** @ DONTSPAMMEokstate.edu>在消息中写道



news:uv ************** @ TK2MSFTNGP09.phx.gbl ...

< blockquote class =post_quotes>提前致谢:

Dim thisperson(7)As Array
Dim validcheck As Boolean = False

thisperson = getperson(usernametextbox。文字,pinnumbertextbox.Text)


私人函数getperson(byval用户名为字符串,byval pinnumber为
字符串)
...
dim returnarray(7)



这不应该是Dim returnarray(7)As Array?

...

错误:在执行函数后,thisperson = ...
抛出了无效的强制转换异常......我在这里缺少什么????

谢谢!
Derek




我不确定是否这是问题,但你应该声明returnarray as

an" Array"对象并指定getperson的返回类型函数

是as Array()。


你实际上是在尝试返回数组吗?

Derek Martin < DM ***** @ DONTSPAMMEokstate.edu>在消息中写道

news:uv ************** @ TK2MSFTNGP09.phx.gbl ...

提前致谢:<暗淡这个人(7)As Array
Dim validcheck As Boolean = False

thisperson = getperson(usernametextbox.Text,pinnumbertextbox.Text)
..私有函数getperson(byval username as string,byval pinnumber as
string)
...
dim returnarray(7)
...

返回returnarray

错误:在thisperson上抛出无效的强制转换异常= ...在
之后执行函数...我在这里缺少什么? ???

谢谢!
Derek



Thanks in advance:

Dim thisperson(7) As Array
Dim validcheck As Boolean = False

thisperson = getperson(usernametextbox.Text, pinnumbertextbox.Text)
....

private function getperson(byval username as string, byval pinnumber as
string)
....
dim returnarray(7)
....

return returnarray

Error: Invalid cast exception is being thrown on thisperson = ... after it
executes the function...what am I missing here????

Thanks!
Derek

解决方案

"Derek Martin" <dm*****@DONTSPAMMEokstate.edu> wrote in message news:uv**************@TK2MSFTNGP09.phx.gbl...

Thanks in advance:

Dim thisperson(7) As Array
Dim validcheck As Boolean = False

thisperson = getperson(usernametextbox.Text, pinnumbertextbox.Text)
...

private function getperson(byval username as string, byval pinnumber as
string)
...
dim returnarray(7)
Should this not be Dim returnarray(7) As Array?
...

return returnarray

Error: Invalid cast exception is being thrown on thisperson = ... after it
executes the function...what am I missing here????

Thanks!
Derek



Well, I was following what you said and actually removed the as array from
thisperson to yield:

Dim thisperson(7)
and then
Dim returnarray(7)

same error....
????
Derek

"Al Reid" <ar*****@reidDASHhome.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

"Derek Martin" <dm*****@DONTSPAMMEokstate.edu> wrote in message


news:uv**************@TK2MSFTNGP09.phx.gbl...

Thanks in advance:

Dim thisperson(7) As Array
Dim validcheck As Boolean = False

thisperson = getperson(usernametextbox.Text, pinnumbertextbox.Text)
...

private function getperson(byval username as string, byval pinnumber as
string)
...
dim returnarray(7)



Should this not be Dim returnarray(7) As Array?

...

return returnarray

Error: Invalid cast exception is being thrown on thisperson = ... after it executes the function...what am I missing here????

Thanks!
Derek




I''m not sure if this is the problem, but you should declare "returnarray" as
an "Array" object and specify the return type of the "getperson" function to
be "as Array()".

Are you actually trying to return an array of arrays?
"Derek Martin" <dm*****@DONTSPAMMEokstate.edu> wrote in message
news:uv**************@TK2MSFTNGP09.phx.gbl...

Thanks in advance:

Dim thisperson(7) As Array
Dim validcheck As Boolean = False

thisperson = getperson(usernametextbox.Text, pinnumbertextbox.Text)
...

private function getperson(byval username as string, byval pinnumber as
string)
...
dim returnarray(7)
...

return returnarray

Error: Invalid cast exception is being thrown on thisperson = ... after it executes the function...what am I missing here????

Thanks!
Derek



这篇关于代码检查请...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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