我正在尝试制作一个编码工具,但我遇到了一个无法修复的错误。
我在互联网上搜索过,但似乎每个错误都有其条件。
// ** encode function
public static void Encode (string Etext) {
// Code here .
// returns the value
return(TEhex); // i think the error is from here .
}
// ** decode function
public static void Decode (string TEdominus2) {
// code here
// returns the value
return TEddominus; // and here .
}
Program.cs(19,17):错误 CS0029:无法将类型“void”隐式转换为“字符串”[C:\Users\HP\Desktop\ME\Coding & Development\Encoding & Cryptography\Dominos_Algorithm\Dominos_Algorithm.csproj] func .cs(38,5):错误 CS0127:由于 'func.Encode(string)' 返回 void,返回关键字后不能跟对象表达式 [C:\Users\HP\Desktop\ME\Coding & Development\ Encoding & Cryptography\Dominos_Algorithm\Dominos_Algorithm.csproj] func.cs(54,5): error CS0127: 由于“func.Decode(string)”返回 void,返回关键字后不能跟对象表达式 [C:\Users \HP\Desktop\ME\Coding & Development\Encoding & Cryptography\Dominos_Algorithm\Dominos_Algorithm.csproj]
您正在尝试从void
方法返回值。将 更改为void
要返回的值的类型。看起来Decode
应该是:
public static string Decode (string TEdominus2)
看起来也Encode
应该是字符串,但我无法从提供的代码中确定。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句