问题描述
您好,
我有一个用Visual Basic编写的代码,我现在用C#编写相同的代码。
Visual Basic中的代码如下:
< pre> Dim Width1500 As 字符串 = fPath + \err \Width1500 \& i1.value
当我尝试在C#中编写相同内容时,它向我显示错误。我写的代码是:
string Width1500 = fPath.ToString ()+ \\\\\\Width1500 \\ + i1。 value ;
我得到的错误是:
错误CS1061:'object'不包含'value'的定义,并且没有扩展方法'value'可以找到'object'类型的第一个参数(你是否错过了使用指令或汇编参考?)
请帮忙。
问候
Aman Chaurasia
我尝试过:
string Width1500 = fPath.ToString()+\\\\\Width1500 \\+ i1.value;
,但它无法帮助。
Hello,
I have a code written in Visual Basic and I am writing the same in C# now.
The code in Visual Basic is as follows:
<pre>Dim Width1500 As String = fPath + "\err\Width1500\" & i1.value
When I tried to write the same in C#, it showed me an error. The code I wrote is:
string Width1500 = fPath.ToString() + "\\err\\Width1500\\" + i1.value;
The error I am getting is:Error CS1061: 'object' does not contain a definition for 'value' and no extension method 'value' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)
Please help.
Regards
Aman Chaurasia
What I have tried:
string Width1500 = fPath.ToString() + "\\err\\Width1500\\" + i1.value;
, but it won't help.
这篇关于C#中visual basic的system.object类的替代方案是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!