Skip to content

Commit 5ea7efe

Browse files
committed
Merge branch 'master' of github.com:heartacker/Python.System
2 parents 9627147 + bc69838 commit 5ea7efe

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"args": [
1010
"exec",
1111
// change to your own folder
12-
"C:/Users/heartacker/.dotnet/tools/.store/dotnet-script/1.4.0/dotnet-script/1.4.0/tools/net7.0/any/dotnet-script.dll",
12+
"${userHome}/.dotnet/tools/.store/dotnet-script/1.4.0/dotnet-script/1.4.0/tools/net7.0/any/dotnet-script.dll",
1313
"${file}"
1414
],
1515
"cwd": "${workspaceRoot}",

CSharp.Scripting.csx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ using Microsoft.CodeAnalysis.CSharp.Scripting;
1010
using Microsoft.CodeAnalysis.CSharp.Syntax;
1111
using System.IO;
1212

13+
var so = ScriptOptions.Default.WithImports("System.IO");
14+
so.WithImports("System");
1315
Console.WriteLine(@"测试输入输出函数:Directory.GetCurrentDirectory()");
14-
var res = await CSharpScript.EvaluateAsync("Directory.GetCurrentDirectory()",
15-
ScriptOptions.Default.WithImports("System.IO"));
16+
var res = await CSharpScript.EvaluateAsync(@"
17+
using System;
18+
Console.WriteLine(10086);
19+
Directory.GetCurrentDirectory()",so);// *if end with ; no return value
1620
Console.WriteLine(res);
1721

1822

0 commit comments

Comments
 (0)