0
I have two methods and I want to find a variable from one method to the other. It is the variable base64
who is in the function base64Decode
.
The code is as follows::
public class WK_UpdateAlvo : CodeActivity
{
[Input("StringFile")]
public InArgument<string> StringFile { get; set; }
protected override void Execute(CodeActivityContext Execontext)
{
ITracingService _tracing;
try
{
AllMethods.Base64Decode(base64);
_tracing.Trace("base64: {0}", base64);
}
catch {
trhow;
}
public class AllMethods
{
//decode a string
public static string Base64Decode(string stringfile)
{
var base64 = System.Convert.FromBase64String(stringfile);
return System.Text.Encoding.UTF8.GetString(base64);
}
}
}
}
Thank you.
Simple. You can’t do that. If you have control over the class, you have to put in a field.
– Bruno Costa
@Claudia, good morning. I didn’t quite understand your question, could you be more objective? from what I’ve seen, you have a method that encodes a string to base 64, and you want to use that variable in another method and that?
– Thomas Erich Pimentel
@Thomaserichpimentel yes that’s it
– Claudia
@Brunocosta can exemplify? Thank you
– Claudia
I don’t know where you got that piece of code from, but it doesn’t sound good. that part of class within class do not know where you want to get with this, you do not reference variable (Internal) method what can be done is the return, ie you can call your method and expect the return variable.
– Marco Souza