c# - Passing values for method -


I'm starting to programming. Can you please show me how to pass values ​​for your compilation () method.

  square cl {private pronoun string clue = @ "cl. Exe"; Private prong string exe = "test.exe", file = "test.cpp"; Private string logic; Public cl (string [] args) {this.args = String.Join ("", args); This.args + = (args.Length & gt; 0? "": "") + "/ Fe" + exe + "+ + file;} public boolean compile (String content, ref string errors) {// any remove old copies if (file. Axis (XE)) file. Delete (exe); If (File.Exists (file)) file. Delete (file); file. write the text (file contents); process proc = new process (); ProckStartInfokUseShellExecute = False; ProckStartInfokRedirectStandardOutput = true; Proc.StartInfo.RedirectStandardError = true; Proc.StartInfo.FileName = Clense; Proc.StartInfo.Arguments = this.args; Proc.StartInfo .CreateNoWindow = True; proc.St Art (); // errors = = proc.StandardError.ReadToEnd (); Errors + = proc.StandardOutput.ReadToEnd (); proc.WaitForExit (); Bull success = file.exis (xi); return success; public boolean compile (string content, ref string errors)   

Do you want to know how to call it? . .

  string content = "#include & lt; stdio.h & gt; \ nmain () {\ nprintf (\" Hello World \ "); \ n} \ n"; String errors = ""; CL = new CL (new string [2] {"/ odd", "/ c"}); If (k.Compile (content, ref errors)) console WrightLine ("Success!"); Else Console.WriteLine ("Failure: {0}", Errors);  

Hope this helps


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -