Providers.java
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:1k
源码类别:
Java编程
开发平台:
Java
- //JavaMail::Providers.java
- //author:ZhangHongbin
- //This program is protected by copyright laws.
- //List supported protocol providers.
- import java.util.*;
- import java.io.*;
- import javax.mail.*;
- public class Providers
- {
- public static void main(String[] args) throws Exception
- {
- Properties props=System.getProperties();
- Session session=Session.getInstance(props,null);
- Provider[] providers =session.getProviders();
- for (int i=0; i <providers.length;++i)
- {
- Provider provider =providers[i];
- System.out.println("provider= "+ provider);
- System.out.println("getProtocol()= "+provider.getProtocol());
- System.out.println("getClassName()= "+provider.getClassName());
- System.out.println("getVendor()= "+provider.getVendor());
- System.out.println("getVersion()= "+provider.getVersion());
- System.out.println("---------------- ");
- }
- }
- }