Random String


Node Information
Generates random text containing A-Z and a-z each time it is requested.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Length IN Int32 ONE FALSE FALSE
Value OUT String MULTIPLE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.Utilities
{
    [IsNode("Random String")]
    public class RandomString : Node
    {
        Port length = new Port(PortType.IN, typeof(int), AcceptsLinks.ONE, "Length");
        Port val = new Port(PortType.OUT, typeof(string), AcceptsLinks.MULTIPLE, "Value");
        public int Length
        {
            set
            {
                if (value < 0)="" {="" value="" +="1;" }="" length.value="value.ToString();" }="" get="" {="" return="" getruntimevalue(length);="" }="" }="" public="" randomstring()="" {="" name="Random String" ;="" length="1;" nodetype="KGraph.NodeType.Function;" returntype="typeof(string);" addport(length);="" addport(val);="" information="Generates random text containing A-Z and a-z each time it is requested." ;="" }="" public="" override="" string="" code()="" {="" return="" "random="" rnd="new" random((int)datetime.now.ticks);="" string="" abc=" + q + " abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"="" +="" q="" +="" ";"="" +="" "int="" length=" + GetValue(length) + " ;"="" +="" "char[]="" str="new" char[length];"="" +="" "for="" (int="" i="0;" i="">< length;="" i++){"="" +="" "str[i]="abc[rnd.Next(abc.Length)];}"" +="" "return="" new="" string(str);";="" }="" }="" }="">