by
0
7
2,420
0
Top 1% !
Popular
Famous
Easy-to-find
Specified
OpenSource
MultiPlatform
Popularity: 7258th place
.NETFramework4.5
Architecturex86_64
Extension.vb
Languagevb.net

Greeting or farewell according to the current time (Saudação ou despedida de acordo com o horário atual)

Returns a text containing the greeting or farewell to the specified language (English, Portuguese or Spanish. Default language is Portuguese)

Retorna um texto contendo a saudação ou despedida de acordo com o idioma especificado (Português, Inglês ou Espanhol. Idioma padrão é português)
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/727259/Greeting-or-farewell-according-to-the-cu?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
//see this and other methods compiled //into a DLL in http://github.com/kaizonaro/innerlibs.net/releases/ Public Function Greeting(Optional Language As String = "pt", Optional Farewell As Boolean = False) As String Dim bomdia As String = "Bom dia" Dim boatarde As String = "Boa tarde" Dim boanoite As String = "Boa noite" Dim boanoite_despedida As String = boanoite Dim seDespedidaManha As String = "tenha um ótimo dia" Dim seDespedidaTarde As String = "tenha uma ótima tarde" Select Case Language.ToLower() Case "en", "eng", "ingles", "english" bomdia = "Good morning" boatarde = "Good afternoon" boanoite = "Good evening" boanoite_despedida = "Good night" seDespedidaManha = "have a nice day" seDespedidaTarde = "have a great afternoon" Exit Select Case "es", "esp", "espanhol", "espanol", "español", "spanish" bomdia = "Buenos días" boatarde = "Buenas tardes" boanoite = "Buenas noches" boanoite_despedida = boanoite seDespedidaManha = "que tengas un buen día" seDespedidaTarde = "que tengas una buena tarde" Exit Select End Select If DateTime.Now.Hour > 6 AndAlso DateTime.Now.Hour < 12 Then Return If(Farewell, seDespedidaManha, bomdia) ElseIf DateTime.Now.Hour >= 12 AndAlso DateTime.Now.Hour < 18 Then Return If(Farewell, seDespedidaTarde, boatarde) Else Return If(Farewell, boanoite_despedida, boanoite) End If End Function
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus