<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    躺在沙灘上的小豬

    快樂的每一天

    #

    共享windows下的文件.

    需要用到以前win下的文件:

    [martinx@martinx martinx]$ su
    Password:
    [root@martinx martinx]
    # mkdir /mnt/temp
    [root@martinx martinx]# mount -t smbfs -o username=martin.xus,password=******
    //192.168.0.229/share /mnt/temp

    或者
    [root@martinx martinx]#  /etc/init.d/smb start
    [root@martinx martinx]# .smbmount -o username=martin.xus,password=******
    //192.168.0.229/share /mnt/temp


    直接訪問即可

    [root@martinx martinx]# ls /mnt/temp


    取消
    [root@martinx martinx]# umount /mnt/temp


    posted @ 2005-10-09 09:32 martin xus| 編輯 收藏

    國慶,放長假嘍 o_o

    今天下午去逛逛,看有什么好東西可以帶走的:)

    posted @ 2005-09-30 11:04 martin xus| 編輯 收藏

    等你說愛我-如果有一天

    來源:pconline  作者:家有小熊

     

    posted @ 2005-09-29 17:09 martin xus| 編輯 收藏

    《Manning.Hibernate.Quickly》 下載

    在別人那里得到的,大體看了一下,真如其名,快速上手很有用。
    但是也正因為如此,書講的比較簡單。有興趣的朋友可以下載看看。
    大體目錄如下:
    ------------------------------------------------------------------
    Why Hibernate?
    Installing and building projects with Ant
    Hibernate basics
    Associations and components
    Collections and custom types



    Unit testing with JUnit and DBUnit
    What’s new in Hibernate 3
    The complete Hibernate mapping catalog
    ------------------------------------------------------------------

    posted @ 2005-09-29 16:30 martin xus| 編輯 收藏

    簡化JavaMail:小巧 Jakarta Commons-Email 簡單教程

    Jakarta發布了Commons Emails 1.0 released 版本,目的是為了簡化JavaMail。

    知道有它幾個class嗎?你一定想不到,只有8個!

    好了,開始我們的jakarta commons emails 之旅:)

    一:Quick Start
    通過SimpleEmail發送郵件
    1java.lang.Object
    2  org.apache.commons.mail.Email
    3      org.apache.commons.mail.SimpleEmail

    1SimpleEmail email = new SimpleEmail();
    2email.setHostName("mail.4ya.cn");
    3email.setAuthentication("<username>","<password>")
    4email.addTo("martin.xus@gmail.com""martin");
    5email.setFrom("martin@4ya.cn""martin");
    6email.setSubject("測試主題");
    7email.setMsg("這里是郵件內容");
    8email.send();

    就如代碼里字面上的意思一樣簡單:
    1:創建以SimpleEmail對象
    2:設定發送信件的smtp服務器,如果沒有設定,會尋找系統變量中mail.host值。
    3:設定smtp的用戶和密碼
    4:收件人
    5:發件人
    6:主題
    7:內容
    8:發送

    二:發送帶附件的郵件
    我們可以發送本機的附件,當然我們也可以發送非本機的附件,如果發送的是一個存在網絡上的附件的url,則郵件發送的時候會自動下載,添加到附件中。

       1:)發送本地附件:
    1EmailAttachment attachment = new EmailAttachment();
    2attachment.setPath("test/test.rar");
    3attachment.setDisposition(EmailAttachment.ATTACHMENT);
    4attachment.setDescription("python resource");
    5attachment.setName("resource");

       2:)發送不存在本地的附件
    1EmailAttachment attachment = new EmailAttachment();
    2attachment.setURL(new URL("http://www.smilinglibrary.org/sldoc/pics/index03.jpg"));
    3attachment.setDisposition(EmailAttachment.ATTACHMENT);
    4attachment.setDescription("微笑圖書館");
    5attachment.setName("微笑圖書館");


    next,添加附件到我們的郵件中
     1MultiPartEmail email = new MultiPartEmail();
     2email.setHostName("mail.4ya.cn");
     3    email.setAuthentication("<username>","<password>")
     4email.addTo("martin.xus@gmail.com""martin");
     5email.setFrom("martin@4ya.cn""martin");
     6email.setSubject("郵件主題");
     7email.setMsg("郵件內容");

     8//添加附件
     9email.attach(attachment);
    10
    11//發送郵件
    12email.send();

    如果需要發送多個附件,只需創建多個EmailAttachement,即可
    1email.attach(attachment1)
    2email.attach(attachment2)

    三:發送html格式的郵件
    通過HtmlEmail我們可以發送Html格式的郵件:

    1java.lang.Object
    2  org.apache.commons.mail.Email
    3      org.apache.commons.mail.MultiPartEmail
    4          org.apache.commons.mail.HtmlEmail
    5

    如下:
     1//HtmlEmail!
     2HtmlEmail email = new HtmlEmail();
     3email.setHostName("mail.4ya.cn");
     3   email.setAuthentication("<username>","<password>")
     5email.addTo("martin@4ya.cn"martin");
     6email.setFrom("martin.xus@gmail.com"martin");
     7email.setSubject("主題:該郵件包括html格式內容");
     
     8// embed the image and get the content id
     9// 注意這里:embed 將幫助我們創建標簽如:cid:xxx url
    10URL url = new URL("http://www.apache.org/images/asf_logo_wide.gif");
    11String cid = email.embed(url, "Apache logo");
    12
    13/**
    14set the html message
    15我們看到HtmlEmail extends Email的,它依然有setMsg(),但是這里發送的郵件包括了插入在郵件內容中的圖片,所以不能在使用了setMsg(),而要以setHtmlMsg 或setTextMsg代碼
    16**/

    17email.setHtmlMsg("<html>The apache logo - <img src=\"cid:"+cid+"\"></html>");
    18
    19// set the alternative message
    20email.setTextMsg("Your email client does not support HTML messages");
    21
    22//set mail
    23email.send();
    24

    四:最后一步
    如果需要實現更復雜authenticator 你可以extends javax.mail.Authenticator ,實現你自己的東西,然后調用Email.setAuthenticator(javax.mail.Authenticator newAuthenticator)即可

    這一點jakarta也做了,給我們提供了一個defaultAuthenticator
    1java.lang.Object
    2  javax.mail.Authenticator
    3      org.apache.commons.mail.DefaultAuthenticator

    覆蓋掉該方法,實現你自己的東東 o_o
    1protected javax.mail.PasswordAuthentication getPasswordAuthentication()


    五:any more?
    當然有了 o_o 以后再寫.

    posted @ 2005-09-29 10:34 martin xus| 編輯 收藏

    僅列出標題
    共28頁: First 上一頁 19 20 21 22 23 24 25 26 27 下一頁 Last 
    主站蜘蛛池模板: 大地资源中文在线观看免费版| 国产亚洲欧美在线观看| 亚洲中文字幕在线第六区| 亚洲精品久久久www| 亚洲一区日韩高清中文字幕亚洲| 亚洲高清国产AV拍精品青青草原| 亚洲国产二区三区久久| 亚洲一区中文字幕| 欧美日韩亚洲精品| 最新国产乱人伦偷精品免费网站| 亚洲国产综合精品一区在线播放| 麻豆va在线精品免费播放| 精品成人免费自拍视频| 日本免费一区尤物| 狠狠色婷婷狠狠狠亚洲综合| 77777亚洲午夜久久多喷| 精品人妻系列无码人妻免费视频| 天天影视色香欲综合免费| 四虎影视www四虎免费| 国产成人A人亚洲精品无码| 久久免费高清视频| 久久久亚洲欧洲日产国码aⅴ| 国产成人va亚洲电影| 免费观看AV片在线播放| 亚洲性日韩精品一区二区三区| 一级做a爱过程免费视频高清| 免费看韩国黄a片在线观看| 日本亚洲欧洲免费天堂午夜看片女人员| 日本一道本不卡免费| 亚洲Av无码乱码在线播放| 亚洲国产精品一区二区三区在线观看 | 日本免费网站在线观看| 美女视频黄频a免费观看| 国产成人综合亚洲AV第一页| 久久国产精品2020免费m3u8| 亚洲成a人片毛片在线| a毛片免费全部在线播放**| 午夜神器成在线人成在线人免费| WWW国产亚洲精品久久麻豆| 亚洲午夜福利在线观看| 一区二区视频在线免费观看|