VB写当fa=1且beng=1时文本颜色黑绿闪烁不是则为黑色
如果您使用的是VB.NET语言,您可以使用以下代码实现所需功能:
If fa = 1 And beng = 1 Then
Console.ForegroundColor = ConsoleColor.Green
Console.BackgroundColor = ConsoleColor.Black
Console.Clear()
While True
Console.Write("Your Text")
Threading.Thread.Sleep(500)
Console.Clear()
Threading.Thread.Sleep(500)
End While
Else
Console.ForegroundColor = ConsoleColor.Black
Console.BackgroundColor = ConsoleColor.Black
Console.Clear()
Console.Write("Your Text")
End If
请注意,以上代码是基于控制台应用程序的,可以在控制台中显示文本,并且只会在fa和beng的值同时为1时才会触发闪烁效果。否则,将以黑色显示文本
原文地址: https://www.cveoy.top/t/topic/iAgq 著作权归作者所有。请勿转载和采集!