public class SfSearchHandler : SearchHandler
{
private readonly MainSearchViewModel _vm = new MainSearchViewModel();
private QuotaViewModel _qvm;
public bool IsBusy => _vm.IsBusy;
public SfSearchHandler()
{
_vm.CompliteItems += Complete;
}
private void Complete()
{
if (_qvm != null)
{
MainThread.BeginInvokeOnMainThread(() =>
{
ItemsSource = _vm.Items.ToList();
_qvm.IsBusy = false;
});
}
}
protected override void OnQueryChanged(string oldValue, string newValue)
{
base.OnQueryChanged(oldValue, newValue);
if (string.IsNullOrWhiteSpace(newValue))
{
ItemsSource = null;
}
else
{
if (BindingContext is QuotaViewModel bs)
{
_qvm = bs;
_qvm.IsBusy = true;
}
_vm.LoadItemsCommand.Execute(newValue);
}
}
// Create net core console application
// Install-Package Microsoft.Windows.Compatibility
// dotnet publish -r win-x64 -c Release
// create service record
// sc create TestService BinPath=C:\full\path\to\publish\dir\WindowsServiceExample.exe
using System;
using System.IO;
using System.ServiceProcess;
using System.Threading;
namespace NetCoreService
{
class Program
{
static void Main(string[] args)
{
var loggingService = new LoggingService();
if (true) //Some check to see if we are in debug mode (Either #IF Debug etc or an app setting)
{
loggingService.OnStartPublic(new string[0]);
while(true)
{
//Just spin wait here.
Thread.Sleep(1000);
}
//Call stop here etc.
}
else
{
ServiceBase.Run(new LoggingService());
}
}
}
public class LoggingService : ServiceBase
{
private const string LogFileLocation = @"C:\temp\servicelog.txt";
private void Log(string logMessage)
{
Directory.CreateDirectory(Path.GetDirectoryName(LogFileLocation));
File.AppendAllText(LogFileLocation, DateTime.UtcNow.ToString() + " : " + logMessage + Environment.NewLine);
}
protected override void OnStart(string[] args)
{
OnStartPublic(args);
base.OnStart(args);
}
protected override void OnStop()
{
Log("Stopping");
base.OnStop();
}
protected override void OnPause()
{
Log("Pausing");
base.OnPause();
}
public void OnStartPublic(string[] args)
{
Log("Starting");
}
}
}
порт 25
Пример процедуры SMTP
Этот пример SMTP показывает почту, отправленную Смитом на хост Alpha.ARPA,
Джонс, Грин и Браун на хосте Beta.ARPA. Здесь мы предполагаем
этот хост Alpha напрямую связывается с хостом Beta.
S: ПОЧТА ОТ:
R: 250 ОК
S: RCPT TO:
R: 250 ОК
S: RCPT TO:
R: 550 Нет такого пользователя здесь
S: RCPT TO:
R: 250 ОК
S: ДАННЫЕ
R: 354 Начать ввод почты; заканчивается .
S: Бла-бла-бла ...
S: ... и т. Д. и т. д.
S: .
R: 250 ОК
https://stackoverflow.com/questions/20632612/custo...