Как получить имя папки без регистрации дополнительных библиотек ?
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);
Как работать с почтой из Nav? Скачайте и зарегестрируйте free библиотеку JMail 4.0 library (jmail.dll), следующий код для отправки сообщения:
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());