Left不是(rms.microsoft.visualbasic。)的成员。 [英] Left is not member of (rms.microsoft.visualbasic.)

查看:121
本文介绍了Left不是(rms.microsoft.visualbasic。)的成员。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误是Left不是visual basic的成员



我尝试过:



Error is Left is not member of of visual basic

What I have tried:

Dim eAmount As Long = RMS.Microsoft.VisualBasic.left(intAmount.ToString.Trim, (intAmount.ToString.Trim.Length - (nSet - 1 * 3)))

推荐答案

有很多错误。

1)左边是一个字符串函数 - 它会返回左手n个字符 - 所以你为什么要尝试将该字符串分配给Long?

2)Left函数是Microsoft.VisualBasic的一部分,而不是RMS.Microsoft.VisualBasic

3)我强烈建议不要使用Microsoft.VisualBasic函数,你移动.NET等价物:在这种情况下 String.Substring [ ^ ]更便于携带,因此更适合日后维护。



要做到这一点,你想使用Substring打破你感兴趣的部分,然后使用 Long.TryParse [ ^ ]将其转换为Long,如果不转换则报告问题。
There are a load of things wrong with that.
1) Left is a string function - it would return the left hand "n" characters - so why are you trying to assign that string to a Long?
2) The Left function is part of Microsoft.VisualBasic, not RMS.Microsoft.VisualBasic
3) I'd strongly suggest that instead of using Microsoft.VisualBasic functions, you move the the .NET equivalents: in this case String.Substring[^] which is a lot more portable and thus better for future maintenance.

To do this properly, you want to use Substring to "break out" the portion you are interested in, and then use Long.TryParse[^] to convert it to a Long, reporting problems if it won't convert.


这篇关于Left不是(rms.microsoft.visualbasic。)的成员。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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