-
大小: 4.23MB文件類型: .zip金幣: 2下載: 0 次發(fā)布日期: 2023-11-08
- 語言: 其他
- 標簽: 物聯(lián)網(wǎng)??智能家居??云??JavaEE??
資源簡介
這是一個家庭物聯(lián)網(wǎng)項目,通過WEB服務(wù)器實現(xiàn)和單片機、手機端、WEB端的交互,最終實現(xiàn)家庭溫度濕度檢測、安全和煙霧報警以及遠程遙控、能源監(jiān)控功能。

代碼片段和文件信息
package?com.yflab.mail;
import?java.sql.SQLException;
import?java.util.Date;
import?com.yflab.model.Energy;
import?com.yflab.util.EnergyDAO;
public?class?MailSender?{
??public?static?void?doMailSend()
??{
??MailSenderInfo?mailInfo?=?new?MailSenderInfo();?
??mailInfo.setMailServerHost(“smtp.126.com“);?
??mailInfo.setMailServerPort(“25“);?
??mailInfo.setValidate(true);?
??mailInfo.setUserName(“axeaux@126.com“);?
??mailInfo.setPassword(“nsfz123456“);//您的郵箱密碼?
??mailInfo.setFromAddress(“axeaux@126.com“);?
??mailInfo.setToAddress(“axeaux@126.com“);?
??mailInfo.setSubject(“您的最新電能使用情況已出“);
??String?contentStr=“截止?“;
??contentStr=contentStr+new?Date().toString();
??Energy?energy=null;
try?{
energy?=?new?EnergyDAO().getEnergyState();
}?catch?(SQLException?e)?{
//?TODO?Auto-generated?catch?block
e.printStackTrace();
}
??if?(energy!=null)
????contentStr=contentStr+“?您累計用電度數(shù)為:“+energy.getTotal()+“?當前用電器功率為:“+energy.getPower();
??else
contentStr=“系統(tǒng)異常,查詢能源使用情況失敗!請聯(lián)系管理員!“;
??mailInfo.setContent(contentStr);?
??SimpleMailSender?sms?=?new?SimpleMailSender();
??????sms.sendTextMail(mailInfo);//發(fā)送文體格式?
??????SimpleMailSender.sendHtmlMail(mailInfo);//發(fā)送html格式
??}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-05-19?14:31??YFLab-2.5.0\
?????文件?????????483??2014-05-19?14:31??YFLab-2.5.0\.gitattributes
?????文件????????2643??2014-05-19?14:31??YFLab-2.5.0\.gitignore
?????文件?????????281??2014-05-19?14:31??YFLab-2.5.0\.myme
?????目錄???????????0??2014-05-19?14:31??YFLab-2.5.0\TCPServ_VS\
?????文件?????????954??2014-05-19?14:31??YFLab-2.5.0\TCPServ_VS\TCPServ_VS.sln
?????目錄???????????0??2014-05-19?14:31??YFLab-2.5.0\TCPServ_VS\TCPServ_VS\
?????文件????????1501??2014-05-19?14:31??YFLab-2.5.0\TCPServ_VS\TCPServ_VS\ReadMe.txt
?????文件????????8380??2014-05-19?14:31??YFLab-2.5.0\TCPServ_VS\TCPServ_VS\TCPServ_VS.cpp
?????文件????????4839??2014-05-19?14:31??YFLab-2.5.0\TCPServ_VS\TCPServ_VS\TCPServ_VS.vcxproj
?????文件????????1282??2014-05-19?14:31??YFLab-2.5.0\TCPServ_VS\TCPServ_VS\TCPServ_VS.vcxproj.filters
?????文件?????????208??2014-05-19?14:31??YFLab-2.5.0\TCPServ_VS\TCPServ_VS\stdafx.cpp
?????文件?????????219??2014-05-19?14:31??YFLab-2.5.0\TCPServ_VS\TCPServ_VS\stdafx.h
?????文件?????????228??2014-05-19?14:31??YFLab-2.5.0\TCPServ_VS\TCPServ_VS\targetver.h
?????文件????????2784??2014-05-19?14:31??YFLab-2.5.0\TCPServ_VS\TestHttp.cpp
?????目錄???????????0??2014-05-19?14:31??YFLab-2.5.0\WebRoot\
?????目錄???????????0??2014-05-19?14:31??YFLab-2.5.0\WebRoot\me
?????文件??????????36??2014-05-19?14:31??YFLab-2.5.0\WebRoot\me
?????目錄???????????0??2014-05-19?14:31??YFLab-2.5.0\WebRoot\WEB-INF\
?????目錄???????????0??2014-05-19?14:31??YFLab-2.5.0\WebRoot\WEB-INF\classes\
?????目錄???????????0??2014-05-19?14:31??YFLab-2.5.0\WebRoot\WEB-INF\classes\com\
?????目錄???????????0??2014-05-19?14:31??YFLab-2.5.0\WebRoot\WEB-INF\classes\com\yflab\
?????目錄???????????0??2014-05-19?14:31??YFLab-2.5.0\WebRoot\WEB-INF\classes\com\yflab\mail\
?????文件????????2027??2014-05-19?14:31??YFLab-2.5.0\WebRoot\WEB-INF\classes\com\yflab\mail\MailSender.class
?????文件????????2906??2014-05-19?14:31??YFLab-2.5.0\WebRoot\WEB-INF\classes\com\yflab\mail\MailSenderInfo.class
?????文件?????????636??2014-05-19?14:31??YFLab-2.5.0\WebRoot\WEB-INF\classes\com\yflab\mail\MailSenderTask.class
?????文件????????1203??2014-05-19?14:31??YFLab-2.5.0\WebRoot\WEB-INF\classes\com\yflab\mail\MailTest.class
?????文件?????????772??2014-05-19?14:31??YFLab-2.5.0\WebRoot\WEB-INF\classes\com\yflab\mail\MyAuthenticator.class
?????文件????????3035??2014-05-19?14:31??YFLab-2.5.0\WebRoot\WEB-INF\classes\com\yflab\mail\SimpleMailSender.class
?????目錄???????????0??2014-05-19?14:31??YFLab-2.5.0\WebRoot\WEB-INF\classes\com\yflab\model\
?????文件????????1270??2014-05-19?14:31??YFLab-2.5.0\WebRoot\WEB-INF\classes\com\yflab\model\Energy.class
............此處省略80個文件信息
評論
共有 條評論