Инструменты пользователя

Инструменты сайта


navision:программирование

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

navision:программирование [2018/04/13 22:43] (текущий)
Строка 1: Строка 1:
 +==== //Полезные Трюки// ====
  
 +     Как получить имя папки без регистрации дополнительных библиотек ?
 +<code pascal>
 +Name   DataType   Subtype   Length 
 +ShellControl   Automation   'Microsoft Shell Controls And Automation'.Shell    
 +Folder   Automation   'Microsoft Shell Controls And Automation'.Folder3    
 +FolderItems   Automation   'Microsoft Shell Controls And Automation'.FolderItems3    
 +FolderItem   Automation   'Microsoft Shell Controls And Automation'.FolderItem2    
 +Foldertxt   Text      1024 
 +
 +if isclear(ShellControl) then 
 +  create(ShellControl); 
 +
 +
 +IF NOT ISCLEAR (ShellControl) THEN
 +  Folder := ShellControl.BrowseForFolder(0,'Выберите Папку',0);
 +IF NOT ISCLEAR (Folder) THEN
 +  FolderItems := Folder.Items();
 +IF NOT ISCLEAR (FolderItems) THEN
 +  FolderItem := FolderItems.Item;
 +IF NOT ISCLEAR (FolderItem) THEN BEGIN
 +  Foldertxt := FORMAT(FolderItem.Path);
 +clear(ShellControl);</code>
 +
 +
 +    Как работать с почтой из Nav?
 +    Скачайте и зарегестрируйте free библиотеку JMail 4.0 library (jmail.dll), следующий код для отправки сообщения:
 +<code pascal>
 +Name DataType Subtype Length
 +MailClient Automation 'JMail 4.0 library'.POP3
 +Mail Automation 'JMail 4.0 library'.Message
 +Attachments Automation 'JMail 4.0 library'.Attachments
 +Attachment Automation 'JMail 4.0 library'.Attachment
 +
 +
 +SMTPServer := 'mail.server.ru';
 +UserName := 'user@server.ru';
 +Password := 'password';
 +
 +IF ISCLEAR(MailClient) THEN
 +  CREATE(MailClient);
 +CREATE(Mail);
 +Mail.From := SendTo."E-Mail Address";
 +Mail.FromName := SendTo.Description;
 +Mail.Subject := Subject;
 +Mail.AddRecipient(EmailReceipient);
 +IF CC <> '' THEN
 +  Mail.AddRecipientCC(CC);
 +Mail.AppendHTML(Text);
 +
 +IF Filename <> '' THEN BEGIN
 +  Mail.AddAttachment(Filename,FALSE);
 +  IF FILE.ERASE(Filename) THEN;
 +END;
 +
 +Mail.MailServerUserName := UserName;
 +Mail.MailServerPassWord := Password;
 +IF NOT Mail.Send(SMTPServer,FALSE) THEN
 +  MESSAGE(Mail.ErrorMessage());
 +</code>
navision/программирование.txt · Последнее изменение: 2018/04/13 22:43 (внешнее изменение)