我如何将此 vb.net 代码转换为 c# 代码?
Public Function SetPiece(ByVal strGlobal As String, ByVal strNodes As String, ByVal strCode As String, ByVal intPiece As Integer, ByVal strNewVal As String) As Boolean
Initialize()
If strGlobal = "" Or strNodes = "" Or strCode = "" Then SetPiece = False
SetPiece = mobjUtility.SetPiece(strGlobal, strNodes, strCode, intPiece, strNewVal)
End Function
我试过这段代码,但出现错误
public bool SetPiece(string strGlobal, string strNodes, string strCode, int intPiece,string strNewVal )
{
bool setPiece = true;
if (strGlobal == "" || strCode == "" )
{
setPiece = false;
setPiece = mobjUtility.SetPiece(strGlobal, strNodes, strCode, intPiece, strNewVal);
}
else if (strNodes == "")
{
setPiece = false;
}
return setPiece;
}
错误是在 SetPiece
我解决了这里的代码:
public static bool SetPiece(string strGlobal, string strNodes, string strCode, int intPiece, string strNewVal)
{
Initialize();
if (((strGlobal == "")
|| ((strNodes == "")
|| (strCode == ""))))
{
return false;
}
var obj = mCache.Static("AGSP.UTILS");
string test = obj.SetPiece(strGlobal, strNodes, strCode, intPiece, strNewVal);
return obj;
}
素胚勾勒不出你
HUX布斯
相关分类