想要通过gmail将目录中的最新文件发送到specfic mail id [英] Want to send the lastest file in a directory to specfic mail id through gmail

查看:65
本文介绍了想要通过gmail将目录中的最新文件发送到specfic mail id的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在目录中发送最新文件,通过gmail发送邮件



ie

If sample1.pdf是最新的,它必须作为邮件发送到收件人邮件ID。



如果sample2.pdf是最新的,它必须作为邮件发送到收件人邮件ID。







需要帮助!!

提前致谢!!



我尝试了什么:



我尝试了很多代码组合。

但是,无法使它成为

I need to send the latest file in a directory, to be sent to mail through gmail

i.e.
If sample1.pdf is the latest, it must be sent as mail to receiver mail id.

If sample2.pdf is the latest, it must be sent as mail to receiver mail id.



Need help!!
Thanks in advance!!

What I have tried:

I tried many combinations of codes.
But, couldn't make it

推荐答案

简单:

Simple:
Dim pathToFolder As String = "D:\Test Data"
Dim files As FileInfo() = New DirectoryInfo(pathToFolder).GetFiles("*.pdf")
Dim file As FileInfo = files.OrderByDescending(Function(fi) fi.CreationTime).FirstOrDefault()
Console.WriteLine(file.Name)


这篇关于想要通过gmail将目录中的最新文件发送到specfic mail id的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆