小编JNW*_*JNW的帖子

如何在没有行号的Latex中进行代码列表(使用lstlisting环境时)

我一直在编写一个项目报告,并使用以下命令添加了一些伪代码:如下所示在Latex中进行lstlisting.

         \begin{lstlisting}[language=c++]

             # On leave focus of email field

           IF email is blank
         Error message: "Please enter an email address"

           ELSE IF email field value is not a valid email address
        Error message: "Wrong email please try again"}  

         # On leave focus of password

          IF password is not sufficiently strong
       Error message: "Password strength is not good" 

         \end{lstlisting}
Run Code Online (Sandbox Code Playgroud)

上面的工作正常,但在代码块中你出现了一些行号,我想借这些.有关如何删除它们的任何提示?我也知道以下内容:

     \section*{New section}
Run Code Online (Sandbox Code Playgroud)

会给出一个没有数字的章节标题.但是在代码列表的情况下,它不起作用并产生错误.

latex

4
推荐指数
1
解决办法
1万
查看次数

不能隐式地将类型'system.timespan'转换为double

我一直试图timer用以下timespan(小时,分钟,秒)添加到我的代码.但无法理解为什么我一直有以下错误:

无法将类型'System.timespan'隐式转换为double.

这是我的代码.

public static void Main(string[] args)
{
    System.Timers.Timer MyTimer = new System.Timers.Timer();
    MyTimer.Elapsed += new ElapsedEventHandler(onTimedEvent);
    MyTimer.Interval = new TimeSpan(0,0,5000);
    MyTimer.Enabled = true;
} 
Run Code Online (Sandbox Code Playgroud)

如果我将Mytimer间隔设置为单个值,则上面的运行没有任何问题,如下所示.

 Mytimer.Interval = 5000;
Run Code Online (Sandbox Code Playgroud)

c# timer

1
推荐指数
1
解决办法
1680
查看次数

标签 统计

c# ×1

latex ×1

timer ×1