/// 废掉其程序功能
/// 作者:[emailprotected]
/// </summary>
/// <param></param>
static public void CreateFile(List<string> strList)
{
//FolderBrowserDialog folder = new FolderBrowserDialog();
//folder.ShowDialog();
//string filepath = folder.SelectedPath;
//关闭阿里的所有服务,启用外部批处理执行
//Alipay payment client security service
//Alipay security business service
//TBSecSvc
string str = System.Windows.Forms.Application.StartupPath;
str += @"\CloseAlipayservice.bat";
Process process = new Process();
process.StartInfo.FileName = str;
process.StartInfo.UseShellExecute = true;
process.Start();
process.WaitForExit();
string strfileNameWithoutExtension;
string strfileNameExtension;
try
{
for (int i = 0; i < strList.Count; i++)
{
//先将文件属性设置为普通,即拥有读写权限,否则会报访问拒绝
System.IO.DirectoryInfo reAttributes = new DirectoryInfo(strList[i]);
reAttributes.Attributes = FileAttributes.Normal;
string fipath = Path.GetDirectoryName(strList[i]);
strfileNameWithoutExtension = Path.GetFileNameWithoutExtension(strList[i]);
strfileNameExtension = Path.GetExtension(strList[i]);
string newFileName = fipath + "\\" + strfileNameWithoutExtension + ".txt";
if (!File.Exists(newFileName))
{
FileStream fs = new FileStream(newFileName, FileMode.Create, FileAccess.Write);
StreamWriter sw = new StreamWriter(fs);
sw.Close();
fs.Close();
if (File.Exists(strList[i]))
{
File.Delete(strList[i]);
}
string fileoldName = newFileName;
string dfilenewName = System.IO.Path.ChangeExtension(fileoldName, strfileNameExtension);
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-24057-3.html
喜欢外景这组有点胶片复古的感觉没有雪梨略不开心
记忆深刻
喘气吗