using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using Shared; namespace Helpers
{
public static class FileHelper
{
#region Methods /// <summary>
/// 向文本文件的尾部追加内容
/// </summary>
/// <param name="filePath"></param>
/// <param name="content">写入的内容</param>
public static void AppendText(string filePath, string content)
{
File.AppendAllText(filePath, content);
} /// <summary>
/// 清空指定目录下所有文件及子目录,但该目录依然保存.
/// </summary>
/// <param name="directoryPath">指定目录的绝对路径</param>
public static void ClearDirectory(string directoryPath)
{
if (IsExistDirectory(directoryPath))
{
//删除目录中所有的文件
var filePaths = GetFileNames(directoryPath);
foreach (var filePath in filePaths)
DeleteFile(filePath); //删除目录中所有的子目录
var directoryPaths = GetDirectories(directoryPath);
foreach (var oneDirectoryPath in directoryPaths)
DeleteDirectory(oneDirectoryPath);
}
} /// <summary>
/// 清空文件内容
/// </summary>
/// <param name="filePath">文件的绝对路径</param>
public static void ClearFile(string filePath)
{
//删除文件
File.Delete(filePath); //重新创建该文件
CreateFile(filePath);
} /// <summary>
/// 检测指定目录中是否存在指定的文件,若要搜索子目录请使用重载方法.
/// </summary>
/// <param name="directoryPath">指定目录的绝对路径</param>
/// <param name="searchPattern">
/// 模式字符串,"*"代表0或N个字符,"?"代表1个字符。
/// 范例:"Log*.xml"表示搜索所有以Log开头的Xml文件。
/// </param>
public static bool Contains(string directoryPath, string searchPattern)
{
try
{
//获取指定的文件列表
var fileNames = GetFileNames(directoryPath, searchPattern, false); //判断指定文件是否存在
return fileNames.Length != ;
}
catch (Exception exception)
{
LogHelper.LogError("Error! ", exception);
return false;
}
} /// <summary>
/// 检测指定目录中是否存在指定的文件
/// </summary>
/// <param name="directoryPath">指定目录的绝对路径</param>
/// <param name="searchPattern">
/// 模式字符串,"*"代表0或N个字符,"?"代表1个字符。
/// 范例:"Log*.xml"表示搜索所有以Log开头的Xml文件。
/// </param>
/// <param name="isSearchChild">是否搜索子目录</param>
public static bool Contains(string directoryPath, string searchPattern, bool isSearchChild)
{
try
{
//获取指定的文件列表
var fileNames = GetFileNames(directoryPath, searchPattern, true); //判断指定文件是否存在
return fileNames.Length != ;
}
catch (Exception exception)
{
LogHelper.LogError("Error! ", exception);
return false;
}
} /// <summary>
/// 将源文件的内容复制到目标文件中
/// </summary>
/// <param name="sourceFilePath">源文件的绝对路径</param>
/// <param name="destFilePath">目标文件的绝对路径</param>
public static void Copy(string sourceFilePath, string destFilePath)
{
File.Copy(sourceFilePath, destFilePath, true);
} /// <summary>
/// 将一个目录的文件拷贝到另外一个目录去
/// </summary>
/// <param name="srcPath">源目录</param>
/// <param name="aimPath">目标目录</param>
/// <param name="flag">是否允许覆盖同名文件</param>
/// <param name="version">当出现多次调用此方法的时候,能够重命名多次,比如xxx.1.old,xxx.2.old</param>
public static void CopyDir(string srcPath, string aimPath, bool flag, int version)
{
// 检查目标目录是否以目录分割字符结束如果不是则添加之
if (aimPath[aimPath.Length - ] != Path.DirectorySeparatorChar)
aimPath += Path.DirectorySeparatorChar; // 判断目标目录是否存在如果不存在则新建之
CreateDirectory(aimPath); // 得到源目录的文件列表,该里面是包含文件以及目录路径的一个数组
// 如果你指向copy目标文件下面的文件而不包含目录请使用下面的方法
var fileList = Directory.GetFileSystemEntries(srcPath); // 遍历所有的文件和目录
foreach (var file in fileList)
try
{
// 如果这是一个目录,并且不是update目录,递归
if (Directory.Exists(file))
{
var path = Path.GetDirectoryName(file);
if (path != null)
{
var dirName = path.Split('\\');
if (dirName[dirName.Length - ].ToLower() != "update")
CopyDir(file, aimPath + Path.GetFileName(file), flag, version);
}
} // 否则直接Copy文件(不拷贝update.xml文件)
else if (!file.ToLower().Contains("update.xml"))
{
//如果是pdb文件,直接忽略
if (file.Contains(".pdb") || file.Contains(".vshost.exe"))
continue;
//如果文件是dll或者exe文件,则可能是正在使用的文件,不能直接替换
if (file.ToLower().Contains(".exe") || file.ToLower().Contains(".dll") ||
file.ToLower().Contains(".pdb"))
{
var exist = false; //正在使用的文件将不能拷贝
var onUsedFiles = AppDomain.CurrentDomain.GetAssemblies(); foreach (var onUsedFile in onUsedFiles)
{
var filename = onUsedFile.ManifestModule.Name; //正在使用的文件
if (file.Contains(filename))
{
//先判断这个文件存在
if (Contains(aimPath, Path.GetFileName(file)))
File.Move(aimPath + Path.GetFileName(file),
aimPath + Path.GetFileName(file) + "." + version + ".old");
File.Copy(file, aimPath + Path.GetFileName(file), true);
exist = true;
break;
}
} //不是依赖项并且本身不是更新程序本身
if (!exist)
File.Copy(file, aimPath + Path.GetFileName(file), true);
//更新程序自身的更新(单独调试此工程的时候需要用到这一段)
/*if (Path.GetFileName(file) == "EastMoney.BPF.DataPlatformUpgrade.exe")
{
try
{
File.Move(aimPath + Path.GetFileName(file),
aimPath + Path.GetFileName(file) + "." + version + ".old"); File.Copy(file, aimPath + Path.GetFileName(file), true);
}
catch (Exception exception)
{
LogHelper.LogError("Error! ", exception);
}
}*/
}
else
{
File.Copy(file, aimPath + Path.GetFileName(file), true);
}
}
}
catch (Exception exception)
{
LogHelper.LogError("拷贝文件失败,失败原因为:" + exception.Message + " 文件名为:" + file, exception);
}
} /// <summary>
/// 创建一个目录
/// </summary>
/// <param name="directoryPath">目录的绝对路径</param>
public static void CreateDirectory(string directoryPath)
{
//如果目录不存在则创建该目录
if (!IsExistDirectory(directoryPath))
Directory.CreateDirectory(directoryPath);
} /// <summary>
/// 创建一个文件。
/// </summary>
/// <param name="filePath">文件的绝对路径</param>
public static bool CreateFile(string filePath)
{
try
{
//如果文件不存在则创建该文件
if (!IsExistFile(filePath))
{
var fileInfo = new FileInfo(filePath); //创建一个FileInfo对象
var fileStream = fileInfo.Create(); //创建文件
fileStream.Close(); //关闭文件流
}
}
catch (Exception exception)
{
LogHelper.LogError("Error! ", exception);
return false;
} return true;
} /// <summary>
/// 创建一个文件,并将字节流写入文件。
/// </summary>
/// <param name="filePath">文件的绝对路径</param>
/// <param name="buffer">二进制流数据</param>
public static bool CreateFile(string filePath, byte[] buffer)
{
try
{
//如果文件不存在则创建该文件
if (!IsExistFile(filePath))
{
//创建一个FileInfo对象
var file = new FileInfo(filePath); //创建文件
var fs = file.Create(); //写入二进制流
fs.Write(buffer, , buffer.Length); //关闭文件流
fs.Close();
}
}
catch (Exception exception)
{
LogHelper.LogError("Error! ", exception);
return false;
}
return true;
} /// <summary>
/// 删除指定目录及其所有子目录(打开状态下降不能删除)
/// </summary>
/// <param name="directoryPath">指定目录的绝对路径</param>
public static void DeleteDirectory(string directoryPath)
{
if (IsExistDirectory(directoryPath))
try
{
Directory.Delete(directoryPath, true);
}
catch (Exception exception)
{
LogHelper.LogError("删除出错,可能是因为文件夹被打开了!请关闭后再试!路径为" + directoryPath + exception.Message, exception);
}
} /// <summary>
/// 调用bat删除目录,以防止系统底层的异步删除机制
/// </summary>
/// <param name="dirPath"></param>
/// <returns></returns>
public static bool DeleteDirectoryWithCmd(string dirPath)
{
var process = new Process(); //string path = ...;//bat路径
var processStartInfo = new ProcessStartInfo("CMD.EXE", "/C rd /S /Q \"" + dirPath + "\"")
{
UseShellExecute = false,
RedirectStandardOutput = true
}; //第二个参数为传入的参数,string类型以空格分隔各个参数
process.StartInfo = processStartInfo;
process.Start();
process.WaitForExit();
var output = process.StandardOutput.ReadToEnd();
if (string.IsNullOrWhiteSpace(output))
return true;
return false;
} /// <summary>
/// 调用bat删除文件,以防止系统底层的异步删除机制
/// </summary>
/// <param name="filePath"></param>
/// <returns></returns>
public static bool DelFileWithCmd(string filePath)
{
var process = new Process(); //string path = ...;//bat路径
var processStartInfo = new ProcessStartInfo("CMD.EXE", "/C del /F /S /Q \"" + filePath + "\"")
{
UseShellExecute = false,
RedirectStandardOutput = true
}; //第二个参数为传入的参数,string类型以空格分隔各个参数
process.StartInfo = processStartInfo;
process.Start();
process.WaitForExit();
var output = process.StandardOutput.ReadToEnd();
if (output.Contains(filePath))
return true;
return false;
} /// <summary>
/// 删除指定文件
/// </summary>
/// <param name="filePath">文件的绝对路径</param>
public static void DeleteFile(string filePath)
{
if (IsExistFile(filePath))
File.Delete(filePath);
} /// <summary>
/// 通过后缀名在目录中查找文件
/// </summary>
/// <param name="directory">目录</param>
/// <param name="pattern">后缀名</param>
public static void DeleteFiles(DirectoryInfo directory, string pattern)
{
if (directory.Exists && pattern.Trim() != string.Empty)
{
try
{
foreach (var fileInfo in directory.GetFiles(pattern))
fileInfo.Delete();
}
catch (Exception exception)
{
LogHelper.LogError("Error! ", exception);
}
foreach (var info in directory.GetDirectories())
DeleteFiles(info, pattern);
}
} /// <summary>
/// 将文件读取到缓冲区中
/// </summary>
/// <param name="filePath">文件的绝对路径</param>
public static byte[] FileToBytes(string filePath)
{
//获取文件的大小
var fileSize = GetFileSize(filePath); //创建一个临时缓冲区
var buffer = new byte[fileSize]; //创建一个文件流
var fileInfo = new FileInfo(filePath);
var fileStream = fileInfo.Open(FileMode.Open); try
{
//将文件流读入缓冲区
fileStream.Read(buffer, , fileSize); return buffer;
}
catch (Exception exception)
{
LogHelper.LogError("Error! ", exception);
return null;
}
finally
{
fileStream.Close(); //关闭文件流
}
} /// <summary>
/// 将文件读取到字符串中
/// </summary>
/// <param name="filePath">文件的绝对路径</param>
public static string FileToString(string filePath)
{
return FileToString(filePath, Encoding.Default);
} /// <summary>
/// 将文件读取到字符串中
/// </summary>
/// <param name="filePath">文件的绝对路径</param>
/// <param name="encoding">字符编码</param>
public static string FileToString(string filePath, Encoding encoding)
{
//创建流读取器
var reader = new StreamReader(filePath, encoding);
try
{
return reader.ReadToEnd(); //读取流
}
catch
{
return string.Empty;
}
finally
{
reader.Close(); //关闭流读取器
}
} /// <summary>
/// 获取指定目录中所有子目录列表,若要搜索嵌套的子目录列表,请使用重载方法.
/// </summary>
/// <param name="directoryPath">指定目录的绝对路径</param>
public static string[] GetDirectories(string directoryPath)
{
try
{
return Directory.GetDirectories(directoryPath);
}
catch (Exception exception)
{
LogHelper.LogError("Error! ", exception);
return null;
}
} /// <summary>
/// 获取指定目录及子目录中所有子目录列表
/// </summary>
/// <param name="directoryPath">指定目录的绝对路径</param>
/// <param name="searchPattern">
/// 模式字符串,"*"代表0或N个字符,"?"代表1个字符。
/// 范例:"Log*.xml"表示搜索所有以Log开头的Xml文件。
/// </param>
/// <param name="isSearchChild">是否搜索子目录</param>
public static string[] GetDirectories(string directoryPath, string searchPattern, bool isSearchChild)
{
try
{
return Directory.GetDirectories(directoryPath, searchPattern,
isSearchChild ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
}
catch (Exception exception)
{
LogHelper.LogError("Error! ", exception);
return null;
}
} /// <summary>
/// 从文件的绝对路径中获取扩展名
/// </summary>
/// <param name="filePath">文件的绝对路径</param>
public static string GetExtension(string filePath)
{
var fileInfo = new FileInfo(filePath); //获取文件的名称
return fileInfo.Extension;
} /// <summary>
/// 从文件的绝对路径中获取文件名( 包含扩展名 )
/// </summary>
/// <param name="filePath">文件的绝对路径</param>
public static string GetFileName(string filePath)
{
//获取文件的名称
var fileInfo = new FileInfo(filePath);
return fileInfo.Name;
} /// <summary>
/// 从文件的绝对路径中获取文件名( 不包含扩展名 )
/// </summary>
/// <param name="filePath">文件的绝对路径</param>
public static string GetFileNameNoExtension(string filePath)
{
//获取文件的名称
var fileInfo = new FileInfo(filePath);
return fileInfo.Name.Split('.')[];
} /// <summary>
/// 获取指定目录中所有文件列表
/// </summary>
/// <param name="directoryPath">指定目录的绝对路径</param>
public static string[] GetFileNames(string directoryPath)
{
if (!IsExistDirectory(directoryPath)) //如果目录不存在,则抛出异常
throw new FileNotFoundException();
return Directory.GetFiles(directoryPath); //获取文件列表
} /// <summary>
/// 获取指定目录及子目录中所有文件列表
/// </summary>
/// <param name="directoryPath">指定目录的绝对路径</param>
/// <param name="searchPattern">
/// 模式字符串,"*"代表0或N个字符,"?"代表1个字符。
/// 范例:"Log*.xml"表示搜索所有以Log开头的Xml文件。
/// </param>
/// <param name="isSearchChild">是否搜索子目录</param>
public static string[] GetFileNames(string directoryPath, string searchPattern, bool isSearchChild)
{
if (!IsExistDirectory(directoryPath)) //如果目录不存在,则抛出异常
throw new FileNotFoundException();
try
{
return Directory.GetFiles(directoryPath, searchPattern,
isSearchChild ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
}
catch (Exception exception)
{
LogHelper.LogError("Error! ", exception);
return null;
}
} /// <summary>
/// 获取一个文件的长度,单位为Byte
/// </summary>
/// <param name="filePath">文件的绝对路径</param>
public static int GetFileSize(string filePath)
{
//创建一个文件对象
var fileInfo = new FileInfo(filePath); //获取文件的大小
return (int) fileInfo.Length;
} /// <summary>
/// 获取一个文件的长度,单位为KB
/// </summary>
/// <param name="filePath">文件的路径</param>
public static double GetFileSizeByKB(string filePath)
{
var fileInfo = new FileInfo(filePath); //创建一个文件对象
var size = fileInfo.Length / ;
return double.Parse(size.ToString()); //获取文件的大小
} /// <summary>
/// 获取一个文件的长度,单位为MB
/// </summary>
/// <param name="filePath">文件的路径</param>
public static double GetFileSizeByMB(string filePath)
{
var fileInfo = new FileInfo(filePath); //创建一个文件对象
var size = fileInfo.Length / / ;
return double.Parse(size.ToString()); //获取文件的大小
} /// <summary>
/// 得到文件大小
/// </summary>
/// <param name="filePath"></param>
/// <returns></returns>
public static long GetFileSizeFromPath(string filePath = null)
{
if (string.IsNullOrEmpty(filePath)) return -;
if (!File.Exists(filePath)) return -;
var objFile = new FileInfo(filePath);
return objFile.Length;
} /// <summary>
/// 获取文本文件的行数
/// </summary>
/// <param name="filePath">文件的绝对路径</param>
public static int GetLineCount(string filePath)
{
//将文本文件的各行读到一个字符串数组中
var rows = File.ReadAllLines(filePath); //返回行数
return rows.Length;
} /// <summary>
/// 检测指定目录是否为空
/// </summary>
/// <param name="directoryPath">指定目录的绝对路径</param>
public static bool IsEmptyDirectory(string directoryPath)
{
try
{
//判断是否存在文件
var fileNames = GetFileNames(directoryPath);
if (fileNames.Length > )
return false; //判断是否存在文件夹
var directoryNames = GetDirectories(directoryPath);
return directoryNames.Length <= ;
}
catch
{
return false;
}
} /// <summary>
/// 检测指定目录是否存在
/// </summary>
/// <param name="directoryPath">目录的绝对路径</param>
public static bool IsExistDirectory(string directoryPath)
{
return Directory.Exists(directoryPath);
} /// <summary>
/// 检测指定文件是否存在,如果存在则返回true。
/// </summary>
/// <param name="filePath">文件的绝对路径</param>
public static bool IsExistFile(string filePath)
{
return File.Exists(filePath);
} /// <summary>
/// 将文件移动到指定目录
/// </summary>
/// <param name="sourceFilePath">需要移动的源文件的绝对路径</param>
/// <param name="descDirectoryPath">移动到的目录的绝对路径</param>
public static void Move(string sourceFilePath, string descDirectoryPath)
{
//获取源文件的名称
var sourceFileName = GetFileName(sourceFilePath); if (IsExistDirectory(descDirectoryPath))
{
//如果目标中存在同名文件,则删除
if (IsExistFile(descDirectoryPath + "\\" + sourceFileName))
DeleteFile(descDirectoryPath + "\\" + sourceFileName);
//将文件移动到指定目录
File.Move(sourceFilePath, descDirectoryPath + "\\" + sourceFileName);
}
} /// <summary>
/// 将流读取到缓冲区中
/// </summary>
/// <param name="stream">原始流</param>
public static byte[] StreamToBytes(Stream stream)
{
try
{
//创建缓冲区
var buffer = new byte[stream.Length]; //读取流
stream.Read(buffer, , int.Parse(stream.Length.ToString())); //返回流
return buffer;
}
catch (Exception exception)
{
LogHelper.LogError("Error! ", exception);
return null;
}
finally
{
stream.Close(); //关闭流
}
} /// <summary>
/// 向文本文件中写入内容,默认UTF8编码
/// </summary>
/// <param name="filePath">文件的绝对路径</param>
/// <param name="content">写入的内容</param>
/// <param name="encoding"></param>
public static void WriteText(string filePath, string content, Encoding encoding = null)
{
if (encoding == null)
{
encoding = Encoding.UTF8;
}
File.WriteAllText(filePath, content, encoding); //向文件写入内容
} #endregion /// <summary>
/// 重命名文件夹内的所有子文件夹 ============================
/// </summary>
/// <param name="directoryName">文件夹名称</param>
/// <param name="newDirectoryName">新子文件夹名称格式字符串</param>
public static bool RenameDirectories(string directoryName, string newDirectoryName)
{
DirectoryInfo directoryInfo = new DirectoryInfo(directoryName);
if (!directoryInfo.Exists)
{
return false;
}
try
{
int i = ; //string[] sDirectories = Directory.GetDirectories(directoryName);
foreach (var sDirectory in directoryInfo.GetDirectories())
{
string sNewDirectoryName = string.Format(newDirectoryName, i++);
string sNewDirectory = Path.Combine(directoryName, sNewDirectoryName);
sDirectory.MoveTo(sNewDirectory);
// Directory.Move(sDirectory, sNewDirectory);
}
return true;
}
catch (Exception exception)
{
LogHelper.LogError("Error! ", exception);
return false;
}
} /// <summary>
/// 文件重命名
/// </summary>
/// <param name="oldFileName"></param>
/// <param name="newFileName"></param>
public static bool FileRename(string filePath, string newFileName)
{
FileInfo fileInfo = new FileInfo(filePath); // 列表中的原始文件全路径名
if (!fileInfo.Exists)
{
return false;
}
// fileInfo.DirectoryName // fileInfo.MoveTo(Path.Combine(newStr));// 改名方法 return true;// 新文件名
}
}
}

[No0000DB]C# FtpClientHelper Ftp客户端上传下载重命名 类封装的更多相关文章

  1. ftp 客户端 上传

    ps: 1.使用netkit-ftp-0.17交叉编译出来的ftp客户端, 2.然后写上传代码,调用ftp传服务器: 3.最好使用bin二进制文件形式传输: 4.ftp客户端和Ubuntu自带的ftp ...

  2. FTP客户端上传下载Demo实现

    1.第一次感觉MS也有这么难用的MFC类: 2.CFtpFileFind类只能实例化一个,多个实例同时查找会出错(因此下载时不能递归),采用队列存储目录再依次下载: 3.本程序支持文件夹嵌套上传下载: ...

  3. linux下常用FTP命令 上传下载文件【转】

    1. 连接ftp服务器 格式:ftp [hostname| ip-address]a)在linux命令行下输入: ftp 192.168.1.1 b)服务器询问你用户名和密码,分别输入用户名和相应密码 ...

  4. Java实现FTP文件上传与下载

    实现FTP文件上传与下载可以通过以下两种种方式实现(不知道还有没有其他方式),分别为:1.通过JDK自带的API实现:2.通过Apache提供的API是实现. 第一种方式 package com.cl ...

  5. Python 基于Python实现Ftp文件上传,下载

    基于Python实现Ftp文件上传,下载   by:授客 QQ:1033553122 测试环境: Ftp客户端:Windows平台 Ftp服务器:Linux平台 Python版本:Python 2.7 ...

  6. ftp服务器上传下载共享文件

    1 windows下搭建ftp服务器 https://blog.csdn.net/qq_34610293/article/details/79210539 搭建好之后浏览器输入 ftp://ip就可以 ...

  7. 使用ftp软件上传下载php文件时换行丢失bug

    正 文:   在使用ftp软件上传下载php源文件时,我们偶尔会发现在本地windows下notepad++编辑器写好的php文件,在使用ftp上传到linux服务器后,php文件的换行符全部丢失了, ...

  8. 使用递归方法实现,向FTP服务器上传整个目录结构、从FTP服务器下载整个目录到本地的功能

    我最近由于在做一个关于FTP文件上传和下载的功能时候,发现Apache FTP jar包没有提供对整个目录结构的上传和下载功能,只能非目录类型的文件进行上传和下载操作,后来我查阅很多网上的实现方法,再 ...

  9. Linux中ftp不能上传文件/目录的解决办法

    在linux中不能上传文件或文件夹最多的问题就是权限问题,但有时也不一定是权限问题了,像我就是空间不够用了,下面我来总结一些ftp不能上传文件/目录的解决办法   在排除用户组和权限等问题后,最可能引 ...

随机推荐

  1. MySQL 5.6新特性 -- crash-safe replication

    在slave上有两个线程:io线程和sql线程io线程接收master的二进制日志信息并写入到本地的relay log中:sql线程执行本地relay log中的信息.io线程读取到的二进制日志当前位 ...

  2. MySQL8的新特性ROLE

    [MySQL的ROLE解决了什么问题] 假设你是一个职业素养良好的DBA比较同时又比较注重权限管理的话:可能遇到过这样的问题,数据库中有多个开发人员的账号:有一天要建 一个新的schema,如果你希望 ...

  3. 游戏编程精粹学习 - 使用Bloom过滤来提高计算性能(BloomFilter)

    原文在<游戏编程精粹2>的1.2中,BloomFilter是一种可以快速检测是否存在集合包含关系的数据结构,但有一定的误识别率. 该结构的优点 判断包含关系时效率较高,粗略测试了下比Lis ...

  4. 《Essential C++》读书笔记 之 基于对象编程风格

    <Essential C++>读书笔记 之 基于对象编程风格 2014-07-13 4.1 如何实现一个class 4.2 什么是Constructors(构造函数)和Destructor ...

  5. (个人)Zookeeper集群环境部署

    一.准备工作 1. 下载zookeeper,下载地址:https://zookeeper.apache.org/releases.html#download  2. 下载CentOS7的镜像,下载地址 ...

  6. php中urlencode和urldecode的用法

    URLEncode:是指针对网页url中的中文字符的一种编码转化方式,最常见的就是Baidu.Google等搜索引擎中输入中文查询时候,生成经过Encode过的网页URL.URLEncode的方式一般 ...

  7. Ubuntu 14.04 安装 Blender,并放桌面

    1.打开Blender官网 2.在主页点击down按钮,跳转到下载页面 3.根据自己的操作系统,选择合适的版本,这里使用的是ubunut 64位,所以下载Linux 64bit,保存文件,一般保存到h ...

  8. css文件的MIME错误引发的Jquery Mobile绘制错误

    静态文件serve设置的MIME不对,引起的浏览器警告 Resource interpreted as Stylesheet but transferred with MIME type applic ...

  9. MTK 修改默认屏幕亮度

    frameworks\base\packages\SettingsProvider\res\values\defaults.xml <!-- Default screenbrightness, ...

  10. SQL创建索引

    http://www.w3school.com.cn/sql/sql_create.asp 注释:更新一个包含索引的表需要比更新一个没有索引的表更多的时间,这是由于索引本身也需要更新.因此,理想的做法 ...