admin管理员组文章数量:1241063
Is there something like console.log in Javascript for Visual Basic?
For example, how can I do this with VB?
var monkey = "chimp"; console.log(monkey); //Logs "chimp" in the console.
Is there something like console.log in Javascript for Visual Basic?
For example, how can I do this with VB?
var monkey = "chimp"; console.log(monkey); //Logs "chimp" in the console.
Share Improve this question edited Nov 10, 2014 at 4:15 user3972104 asked Nov 10, 2014 at 3:46 EnochEnoch 2521 gold badge4 silver badges12 bronze badges 2- 1 Use breakpoints in Visual Studio. – David East Commented Nov 10, 2014 at 3:47
-
Console.Write
orConsole.WriteLine
if you're building a console app.MessageBox.Show
for a WinForms app. But the debugger is the best way to check values in a .NET program. You can putdebugger();
in JavaScript to step into the program from IE into the Visual Studio IDE as well. – Tim Commented Nov 10, 2014 at 3:50
1 Answer
Reset to default 11It depends on the platform and application you are using and more importantly the purpose of the logging.
You can use the Console
class which offers Write
and WriteLine
static methods. This will write your log to standard console. For a console application, this is the best choice:
System.Console.WriteLine("Log text")
If you are using the log just for debugging purposes, you can use the System.Diagnostics.Debug
class with WriteLine
static method. This class also offers a WriteLineIf
method which accepts an argument of type Boolean
and writes the log if the value passed for that argument equals to True
:
System.Diagnostics.Debug.WriteLineIf(x = y, "They are equal")
You can view the debug console output in Visual Studio's output window.
本文标签: javascriptSimilar operation for Consolelog in VBNetStack Overflow
版权声明:本文标题:javascript - Similar operation for Console.log in VB.Net? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740046189a2221922.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论