using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Collections;namespace _oneline
{
class Program
{
static void Main(string[] args)
{
string path = @"D:\\MS_HD_08_H576i25_to_H264_960x1080p25_4.sh"; FileStream fs = new FileStream(path, FileMode.Open, FileAccess.ReadWrite, FileShare.None);
StreamReader sr = new StreamReader(fs);
StreamWriter sr_ = new StreamWriter(fs);
// using (StreamReader sr = new StreamReader("D:\\MS_HD_08_H576i25_to_H264_960x1080p25_4.sh"))
{
String line;
string wh1 = "";
string ht1 = "";
string instance = "";
List<string> hts = new List<string>();
List<string> whs = new List<string>();
List<int> inst = new List<int>(); int z = 0;
// Read and display lines from the file until the end of
// the file is reached.
while((line = sr.ReadLine()) != null)
{ if (line.Contains(@"./xcode.configVpp.pl"))
{
string str = line;
string[] ss = str.Split(' ');
for (int i = 0; i < ss.Length; i++)
{
if (ss[i] == "-height")
{
ht1 = ss[i + 1];
hts.Add(ht1); }
}
for (int j = ss.Length - 1; j >= 0; j--)
{
if (ss[j] == "-width")
{
wh1 = ss[j + 1];
whs.Add(wh1); }
}
for (int t = 0; t < ss.Length - 1; t++)
{
if (ss[t] == "-instance")
{
instance = ss[t + 1];
inst.Add(int.Parse(instance)); }
} }
} for (z = 0; z < inst.Count; z++)
{
if ((inst[z] == 0)||(inst[z] == 4||inst[z] == 8||inst[z] == 12))
{
if ((int.Parse(hts[z]) < 192 )||( int.Parse(hts[z]) > 576))
{ hts[z] = hts[z].Replace(hts[z],"576");
}
sr_.Write(hts[z]);
Console.WriteLine(hts[z]);
if ((int.Parse(whs[z]) < 352) ||( int.Parse(whs[z]) > 1024))
{
whs[z] = whs[z].Replace(whs[z],"1024");
}
sr_.Write(whs[z]); Console.WriteLine(whs[z]); } }
Console.ReadLine();
}
}
}
}C#
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Collections;namespace _oneline
{
class Program
{
static void Main(string[] args)
{
string path = @"D:\\MS_HD_08_H576i25_to_H264_960x1080p25_4.sh"; FileStream fs = new FileStream(path, FileMode.Open, FileAccess.ReadWrite, FileShare.None);
StreamReader sr = new StreamReader(fs);
StreamWriter sr_ = new StreamWriter(fs);
// using (StreamReader sr = new StreamReader("D:\\MS_HD_08_H576i25_to_H264_960x1080p25_4.sh"))
{
String line;
string wh1 = "";
string ht1 = "";
string instance = "";
List<string> hts = new List<string>();
List<string> whs = new List<string>();
List<int> inst = new List<int>(); int z = 0;
// Read and display lines from the file until the end of
// the file is reached.
while((line = sr.ReadLine()) != null)
{ if (line.Contains(@"./xcode.configVpp.pl"))
{
string str = line;
string[] ss = str.Split(' ');
for (int i = 0; i < ss.Length; i++)
{
if (ss[i] == "-height")
{
ht1 = ss[i + 1];
hts.Add(ht1); }
}
for (int j = ss.Length - 1; j >= 0; j--)
{
if (ss[j] == "-width")
{
wh1 = ss[j + 1];
whs.Add(wh1); }
}
for (int t = 0; t < ss.Length - 1; t++)
{
if (ss[t] == "-instance")
{
instance = ss[t + 1];
inst.Add(int.Parse(instance)); }
} }
} for (z = 0; z < inst.Count; z++)
{
if ((inst[z] == 0)||(inst[z] == 4||inst[z] == 8||inst[z] == 12))
{
if ((int.Parse(hts[z]) < 192 )||( int.Parse(hts[z]) > 576))
{ hts[z] = hts[z].Replace(hts[z],"576");
}
sr_.Write(hts[z]);
Console.WriteLine(hts[z]);
if ((int.Parse(whs[z]) < 352) ||( int.Parse(whs[z]) > 1024))
{
whs[z] = whs[z].Replace(whs[z],"1024");
}
sr_.Write(whs[z]); Console.WriteLine(whs[z]); } }
Console.ReadLine();
}
}
}
}C#
解决方案 »
- mouseDown()事件归属问题
- 远程桌面连接teamviewer会启动DHCP服务吗?
- 将3DMax中.ase格式的文件转换成.xaml格式的文件
- C# 禁止复制文件夹
- ******一个有趣的话题******关于WININET.DLL中的FtpPutFile函数*************
- 服务器怎么样同时监听多个客户端?
- C# wpf datagrid 动态加载数据后改变单元格颜色bug
- 请问各位大虾,怎样才能运行C#程序?
- C#.net中(exe,dll)文件版本生成问题?
- 如何通过查询将数据库中的几个表分别显示到tabControl中的几个对应的tabpage中
- |ZYCWPF| WINAPI 如何枚举窗体所有控件? 谢谢
- C# 私钥加密 公钥解密 你没看错。不是玩数字签名
sr_.Flush();
sr_.Close();