Android中写文本文件的方法
摘要:下面是我在Android开发中,一个写文本文件的方法,代码如下: //将字符串写入到文本文件中 public static void WriteTxtFile(String strcontent,String strFilePath) ...
阅读全文
Android中写文本文件的方法
摘要:下面是我在Android开发中,一个写文本文件的方法,代码如下://将字符串写入到文本文件中 public static void WriteTxtFile(String strcontent,String strFilePath) { //每次写入时,都换行写 String strContent=strcontent+"\n"; try { File file = new File(strFilePath); if (!file.exists()) { Log.d("TestFile", "Create the file:" + s
阅读全文
Android中读取文本文件中内容的方法
摘要:这几天在项目开发中,要读取文本文件中内容的,因此写了个读取文本文件中内容的方法,代码如下: //读取文本文件中的内容 public static String ReadTxtFile(String strFilePath) { ...
阅读全文
Android中读取文本文件中内容的方法
摘要:这几天在项目开发中,要读取文本文件中内容的,因此写了个读取文本文件中内容的方法,代码如下://读取文本文件中的内容 public static String ReadTxtFile(String strFilePath) { String path = strFilePath; String content = ""; //文件内容字符串 //打开文件 File file = new File(path); //如果path是传递过来的参数,可以做一个非目录的判断 if (file.isDirectory()) { Log.d("TestFile", &
阅读全文
使用C#ping主机的方法
摘要:在我们开发项目时经常会遇到要ping主机的问题,现在我封装了一个ping主机的方法,代码如下: /// <summary> /// Ping指定的主机,看能否ping通 /// </summary> /// <param name="Address">(主机地址)</param> /// <param name="TimeOut">(超时时间,默认:1s)</param> /// <returns>True if a response is received, false
阅读全文
使用C#ping主机的方法
摘要:在我们开发项目时经常会遇到要ping主机的问题,现在我封装了一个ping主机的方法, 代码如下: /// /// Ping指定的主机,看能否ping通 /// /// (主机地...
阅读全文
分享一个异步发送邮件的类
摘要:首先要定义一个邮件信息的基类,如下所示:/// <summary> /// Base message class used for emails /// </summary> public class Message { #region Constructor /// <summary> /// Constructor /// </summary> public Message() { } #endregion #region Properties /// <summary> /// Whom the message is to //
阅读全文
分享一个异步发送邮件的类
摘要:首先要定义一个邮件信息的基类,如下所示: /// /// Base message class used for emails /// public class Message { #region Co...
阅读全文