A
Ai Guo
Guest
Hi,
How to correct
Error 1 Invalid token '(' in class, struct, or interface member declaration C:\App3\Program.cs 90 32 Validate_File1
Error 2 Invalid token ',' in class, struct, or interface member declaration C:\App3\Program.cs 90 35 Validate_File1
Error 3 Invalid token ',' in class, struct, or interface member declaration C:\App3\Program.cs 90 42 Validate_File1
to code below?
using System;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.UI;
using System.IO.Compression;
using System.Text.RegularExpressions;
using System.Xml;
using System.Globalization;
//using Ionic.Zip;
using System.Net;
using System.Net.Http;
using System.Collections.Generic;
using System.Data.OleDb;
//using Microsoft.VisualBasic;
using System.Text; // This was needed to make ASCIIEncoding function
using System.Security.Cryptography; // This was needed to make everything related to MD5 function
namespace Validate_File1
{
class Program
{
static void Main(string[] args)
{
string File0, File1, File2, File3, Call_Sign, Line0, Line1 = "", Line2 = "", Line3 = "", Line_Hold = "", ftx_Line1 = "", eqd_Line1 = "", cta_Line1 = "", Ver0 = "", line = "", Str0, Str1 = "", Str2 = "";
int Pos0, Pos1, Pos2, Pos3, Pos4, Pos5, Pos6, Pos7, Pos8, Pos9, Pos10 = 0, Pos11 = 0, Pos12, Pos13, Pos14, Pos15, Pos_Hold0, Pos_Hold1, Sep_Count, Len0, UNT_pos, Tot_line, Total_Line1 = 0, eqd2_line_cnt = 0, TDT_cnt = 0;
bool UNB_Exist, UNZ_Exist, UNT_Exist, NAD_Exist = false, Voy_Ref0, Voy_Ref1, dtm_Line = false, nad_Line = false, doc_Line = false, eqd2_line = false, eqd3_line = false, cta_Line, cta_OK, codeco = false, Found0, BGM_line = false, TDT_line = false, LOC_line = false;
bool allowappend = true;
File0 = args[0];
if (File0.Trim()=="")
{
Console.WriteLine("Please have a proper input with one file name!");
return;
}
//System.IO.File.WriteAllText(File0, Str20);
string f0 = "", f1 = "", s0 = "", s1 = "", d0 = "", d1 = "";
int pos0 = 0, pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0, pos5 = 0, pos6 = 0, pos7 = 0, pos8 = 0, pos9 = 0; Boolean wrt_empt = false;
string OutFile = "";
string Name1 = "", Name_H = "";
string AccessTime1 = "";
string WriteTime1 = "";
bool Cont0 = true; bool Cont1 = true; wrt_empt = false;
using (StreamReader sr = new StreamReader(@File0, Encoding.Default))
{
Random random=new Random();
string s_rand = random.Next(1000).ToString().Trim();
//f1 = File0.Replace("y:/BizIn/error/", "");
string s_ext = Path.GetExtension(@File0);
f1 = File0.Replace(s_ext, "");
f1 = f1 + s_rand + s_ext;
while ((line = sr.ReadLine()) != null && Cont0)
{
using (StreamWriter sw = new StreamWriter(@f1, true, Encoding.Default))
{
sw.WriteLine(line.Trim());
//if (line.Trim() == "")
//wrt_empt = true;
//sw.WriteLine((Att0.ToString().Trim() == "Directory" ? "Directory - " : "File - ") + Name.ToString().Trim() + " Access time - " + AccessTime.ToString().Trim() + " Write time - " + WriteTime.ToString().Trim());
}
}
}
}
System.IO.File.Copy(f1, File0, true);
File.Delete(f1);
}
}
}
Many Thanks & Best Regards, Hua Min
Continue reading...
How to correct
Error 1 Invalid token '(' in class, struct, or interface member declaration C:\App3\Program.cs 90 32 Validate_File1
Error 2 Invalid token ',' in class, struct, or interface member declaration C:\App3\Program.cs 90 35 Validate_File1
Error 3 Invalid token ',' in class, struct, or interface member declaration C:\App3\Program.cs 90 42 Validate_File1
to code below?
using System;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.UI;
using System.IO.Compression;
using System.Text.RegularExpressions;
using System.Xml;
using System.Globalization;
//using Ionic.Zip;
using System.Net;
using System.Net.Http;
using System.Collections.Generic;
using System.Data.OleDb;
//using Microsoft.VisualBasic;
using System.Text; // This was needed to make ASCIIEncoding function
using System.Security.Cryptography; // This was needed to make everything related to MD5 function
namespace Validate_File1
{
class Program
{
static void Main(string[] args)
{
string File0, File1, File2, File3, Call_Sign, Line0, Line1 = "", Line2 = "", Line3 = "", Line_Hold = "", ftx_Line1 = "", eqd_Line1 = "", cta_Line1 = "", Ver0 = "", line = "", Str0, Str1 = "", Str2 = "";
int Pos0, Pos1, Pos2, Pos3, Pos4, Pos5, Pos6, Pos7, Pos8, Pos9, Pos10 = 0, Pos11 = 0, Pos12, Pos13, Pos14, Pos15, Pos_Hold0, Pos_Hold1, Sep_Count, Len0, UNT_pos, Tot_line, Total_Line1 = 0, eqd2_line_cnt = 0, TDT_cnt = 0;
bool UNB_Exist, UNZ_Exist, UNT_Exist, NAD_Exist = false, Voy_Ref0, Voy_Ref1, dtm_Line = false, nad_Line = false, doc_Line = false, eqd2_line = false, eqd3_line = false, cta_Line, cta_OK, codeco = false, Found0, BGM_line = false, TDT_line = false, LOC_line = false;
bool allowappend = true;
File0 = args[0];
if (File0.Trim()=="")
{
Console.WriteLine("Please have a proper input with one file name!");
return;
}
//System.IO.File.WriteAllText(File0, Str20);
string f0 = "", f1 = "", s0 = "", s1 = "", d0 = "", d1 = "";
int pos0 = 0, pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0, pos5 = 0, pos6 = 0, pos7 = 0, pos8 = 0, pos9 = 0; Boolean wrt_empt = false;
string OutFile = "";
string Name1 = "", Name_H = "";
string AccessTime1 = "";
string WriteTime1 = "";
bool Cont0 = true; bool Cont1 = true; wrt_empt = false;
using (StreamReader sr = new StreamReader(@File0, Encoding.Default))
{
Random random=new Random();
string s_rand = random.Next(1000).ToString().Trim();
//f1 = File0.Replace("y:/BizIn/error/", "");
string s_ext = Path.GetExtension(@File0);
f1 = File0.Replace(s_ext, "");
f1 = f1 + s_rand + s_ext;
while ((line = sr.ReadLine()) != null && Cont0)
{
using (StreamWriter sw = new StreamWriter(@f1, true, Encoding.Default))
{
sw.WriteLine(line.Trim());
//if (line.Trim() == "")
//wrt_empt = true;
//sw.WriteLine((Att0.ToString().Trim() == "Directory" ? "Directory - " : "File - ") + Name.ToString().Trim() + " Access time - " + AccessTime.ToString().Trim() + " Write time - " + WriteTime.ToString().Trim());
}
}
}
}
System.IO.File.Copy(f1, File0, true);
File.Delete(f1);
}
}
}
Many Thanks & Best Regards, Hua Min
Continue reading...