资源简介
C# Winform 发票信息修改 文本内容修改 指定文本覆盖 文件名修改 另存 保存
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace Invoice_info_amend
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender EventArgs e)
{
}
private void button2_Click(object sender EventArgs e)
{
string bak = Application.StartupPath + DateTime.Now.ToString(“yyyy-MM-dd“) + “.txt“;
//string path = “E:\\GPO\\Regional\\“;
string path = textBox8.Text+“\\“;
string[] pathFile = Directory.GetFiles(path);
//string newpath = “E:\\GPO\\Mend\\“;
string newpath = textBox9.Text+“\\“;
string con = ““;
int i = 0;
foreach (string str in pathFile)
{
FileStream fs = new FileStream(str FileMode.Open FileAccess.Read);
StreamReader sr = new StreamReader(fs);
//Encoding enc = System.Text.Encoding.GetEncoding(fs);
string[] lines = File.ReadAllLines(str);
string filename = System.IO.Path.GetFileNameWithoutExtension(str);
textBox1.Text = filename;
string[] sArray = filename.Split(new char[] { ‘_‘ });
textBox2.Text = textBox4.Text + “_“ + textBox5.Text;
textBox3.Text = sArray[0];
//textBox5.Text = sArray[1];
textBox6.Text = lines[0];
textBox4.Text = System.Text.Regularexpressions.Regex.Replace(textBox6.Text @“[^0-9]+“ ““);
string hm = lines[1];
textBox5.Text = System.Text.Regularexpressions.Regex.Replace(hm @“[^0-9]+“ ““);
//textBox3.Text = System.Text.Regularexpressions.Regex.Replace(textBox4.Text @“[^0-9]+“ ““);
con = sr.ReadToEnd();
con = con.Replace(textBox3.Text textBox4.Text);
//con = con.Replace(con textBox1.Text textBox2.Text);
sr.Close();
fs.Close();
FileStream ba = new FileStream(bak FileMode.Append FileAccess.Write);
StreamWriter ba2 = new StreamWriter(ba);
ba2.WriteLine(filename);
ba2.Close();
ba.Close();
FileStream fs2 = new FileStream(newpath + textBox4.Text + “_“ + textBox5.Text + “.txt“ FileMode.Create FileAccess.Write);
StreamWriter sw = new StreamWriter(fs2 System.Text.Encoding.Unicode);
sw.WriteLine(con);
sw.Close();
fs2.Close();
string photo1 = path + filename + “.jpg“;
string photo2 = newpath + textBox4.Te
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 187 2019-04-10 22:12 Invoice_info_amend\Invoice_info_amend\App.config
文件 3408 2019-04-23 10:43 Invoice_info_amend\Invoice_info_amend\Form1.cs
文件 14363 2019-04-23 10:43 Invoice_info_amend\Invoice_info_amend\Form1.Designer.cs
文件 5817 2019-04-23 10:43 Invoice_info_amend\Invoice_info_amend\Form1.resx
文件 3815 2019-04-10 22:22 Invoice_info_amend\Invoice_info_amend\Invoice_info_amend.csproj
文件 1308 2019-04-22 15:14 Invoice_info_amend\Invoice_info_amend\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7120 2019-04-10 22:12 Invoice_info_amend\Invoice_info_amend\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 976 2019-04-23 10:43 Invoice_info_amend\Invoice_info_amend\obj\Debug\Invoice_info_amend.csproj.FileListAbsolute.txt
文件 975 2019-04-23 10:43 Invoice_info_amend\Invoice_info_amend\obj\Debug\Invoice_info_amend.csproj.GenerateResource.Cache
文件 14336 2019-04-23 10:43 Invoice_info_amend\Invoice_info_amend\obj\Debug\Invoice_info_amend.exe
文件 180 2019-04-23 10:43 Invoice_info_amend\Invoice_info_amend\obj\Debug\Invoice_info_amend.Form1.resources
文件 24064 2019-04-23 10:43 Invoice_info_amend\Invoice_info_amend\obj\Debug\Invoice_info_amend.pdb
文件 180 2019-04-23 10:43 Invoice_info_amend\Invoice_info_amend\obj\Debug\Invoice_info_amend.Properties.Resources.resources
文件 0 2019-04-10 22:12 Invoice_info_amend\Invoice_info_amend\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
文件 0 2019-04-10 22:12 Invoice_info_amend\Invoice_info_amend\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
文件 0 2019-04-10 22:12 Invoice_info_amend\Invoice_info_amend\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
文件 530 2019-04-10 22:12 Invoice_info_amend\Invoice_info_amend\Program.cs
文件 1356 2019-04-10 22:12 Invoice_info_amend\Invoice_info_amend\Properties\AssemblyInfo.cs
文件 2888 2019-04-10 22:12 Invoice_info_amend\Invoice_info_amend\Properties\Resources.Designer.cs
文件 5612 2019-04-10 22:12 Invoice_info_amend\Invoice_info_amend\Properties\Resources.resx
文件 1105 2019-04-10 22:12 Invoice_info_amend\Invoice_info_amend\Properties\Settings.Designer.cs
文件 249 2019-04-10 22:12 Invoice_info_amend\Invoice_info_amend\Properties\Settings.settings
文件 944 2019-04-10 22:12 Invoice_info_amend\Invoice_info_amend.sln
..A..H. 36352 2019-04-23 17:58 Invoice_info_amend\Invoice_info_amend.v11.suo
目录 0 2019-04-10 22:12 Invoice_info_amend\Invoice_info_amend\obj\Debug\TempPE
目录 0 2019-04-23 10:43 Invoice_info_amend\Invoice_info_amend\obj\Debug
目录 0 2019-04-10 22:12 Invoice_info_amend\Invoice_info_amend\obj
目录 0 2019-04-10 22:12 Invoice_info_amend\Invoice_info_amend\Properties
目录 0 2019-04-23 17:58 Invoice_info_amend\Invoice_info_amend
目录 0 2019-04-10 22:12 Invoice_info_amend
............此处省略3个文件信息
相关资源
- C# Winform 左侧菜单右边显示、子窗体显
- C#连接数据库实现删改查代码
- 聊天控件源码_支持动态表情(C#)
- C#源码图片验证码识别
- 异步串行串口通讯C#RS232
- C#流程图编程演示(用GDI+实现鼠标绘
- c# 用SAPI实现语音识别及文本转换的详
- C#图书管理系统全源代码!
- 用C#实现跳马问题程序
- C#取得SysListView32所有行(包括列表头
- C#WinForm版 《仿360杀毒页面切换动画效
- 一个很不错的C#录音控件源码,帮您提
- c# winfrom实现票据打印系统源代码自己
- C# 语法全解
- 用c#实现窗体绘制椭圆,圆,矩形
- ASP.NET简单留言板(C#)
- C# 串口源码
- C#多线程开发多个
- C#微信企业号接收和发送消息
- C#access数据库连接的代码解释
- c#经典图书管理系统
- ArcGIS+Engine+C#
- C#的一个简单的图书管理系统
- C# webbrowser扩展组件-IEBrowser.2.5.
- C# lexer 语法解析器
- delphi转c#破解版
- 真正能用 c# 摄像头 控制 截屏 拍照
- C# winform/web导出EXCEL
- 用C#语言做的GUI图形界面的贪吃蛇
- c#做的学生选课系统代码完整
评论
共有 条评论