using System;
using System.Runtime.InteropServices;
public class Program
{
[DllImport("kernel32.dll", ExactSpelling = true)]
private static extern IntPtr GetConsoleWindow();
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern bool EnableScrollBar(IntPtr hWnd, int wSBflags, int wArrows);
public static void Main(string[] args)
{
IntPtr handle = GetConsoleWindow();
EnableScrollBar(handle, 3, 3);
}
}
class Program
{
private const int MF_BYCOMMAND = 0x00000000;
public const int SC_CLOSE = 0xF060;
public const int SC_MINIMIZE = 0xF020;
public const int SC_MAXIMIZE = 0xF030;
public const int SC_SIZE = 0xF000;
[DllImport("user32.dll")]
public static extern int DeleteMenu(IntPtr hMenu, int nPosition, int wFlags);
[DllImport("user32.dll")]
private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
[DllImport("kernel32.dll", ExactSpelling = true)]
private static extern IntPtr GetConsoleWindow();
static void Main(string[] args)
{
IntPtr handle = GetConsoleWindow();
IntPtr sysMenu = GetSystemMenu(handle, false);
if (handle != IntPtr.Zero)
{
DeleteMenu(sysMenu, SC_MINIMIZE, MF_BYCOMMAND);
DeleteMenu(sysMenu, SC_MAXIMIZE, MF_BYCOMMAND);
DeleteMenu(sysMenu, SC_SIZE, MF_BYCOMMAND);
}
Console.Read();
}
}
With Selection.Find
.Text = ", -"
.Replacement.Text = """, -"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Worksheet_Change
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("AF9:AH9")) Is Nothing Then
If Target.Value2 = "" Then
Target.EntireColumn.Hidden = True
End If
End If
End Sub
static void Main(string[] args)
{
string[] arrDate = { "09.08.2018 13:04:07"
, "11.05.2018 11:03:00"
, "16.07.2018 13:28:12" };
string[] arrFileName = { "nameFile_1301_1602__2018_08_09__13_04_07_990"
, "nameFile_1302_1602__2018_05_11__11_03_40_910"
, "nameFile_1302_1602__2018_07_16__13_28_12_950" };
foreach (var strDate in arrDate)
{
var pattern = GetSearchPattern(strDate);
if (pattern!=null)
{
var fileName = arrFileName.FirstOrDefault(f=>f.Contains(pattern));
if (fileName == null) continue;
string otvet = "Дата: " + strDate + "Файл с этой датой: " + fileName;
Console.WriteLine(otvet);
}
}
}
static string GetSearchPattern(string strDate)
{
DateTime date = new DateTime();
if (!DateTime.TryParse(strDate, out date)) return null;
return date.ToString("__yyyy_MM_dd__HH_mm_ss_");
}
using System;
using MailKit.Net.Imap;
using MailKit;
namespace MailKit_app
{
class Program
{
static void Main(string[] args)
{
using (var client = new ImapClient())
{
client.ServerCertificateValidationCallback = (s, c, h, e) => true;
client.Connect("imap.yandex.ru", 993, true);
client.Authenticate("login@yandex.ru", "password");
var junk = client.GetFolder(SpecialFolder.Junk);
junk.Open(FolderAccess.ReadOnly);
Console.WriteLine("Total messages: {0}", junk.Count);
Console.WriteLine("Recent messages: {0}", junk.Recent);
for (int i = 0; i < junk.Count; i++)
{
var message = junk.GetMessage(i);
Console.WriteLine("Subject: {0}", message.Subject);
}
client.Disconnect(true);
}
}
}
}
Sub PrintSelectedPages()
Dim strPages As String
strPages = strPages & IIf(CheckBox1.Value, IIf(strPages = "", "", ",") & "2", "")
strPages = strPages & IIf(CheckBox2.Value, IIf(strPages = "", "", ",") & "3", "")
If Not strPages = "" Then Application.PrintOut Range:=wdPrintRangeOfPages, Pages:=strPages
End Sub
string text = xmlColItems.Descendants("weather")
.Descendants("city")
.Descendants("cityname2").FirstOrDefault()?.Value;
=or(iserror(A1) , isna(A1))