static string deleteComments(string s) //Remove comments starting with //
{
if (s == null) return s;
int pos = ("//");
if (pos < 0) return s;
return (0, pos);
}
if (("Temp"))
("Temp");
if ((""))
("");
if ((""))
("");
("Temp");
DirectoryInfo dir = new DirectoryInfo(".");
ArrayList folders = new ArrayList();
FileSystemInfo[] fileArr = ();
(fileArr);
for (int i = 0; i < ; i++)
{
FileInfo f = folders[i] as FileInfo;
if (f == null)
{
DirectoryInfo d = folders[i] as DirectoryInfo;
if (!("Debug") && !("Release") && !="Temp")
{
("Temp" + "\\" + );
(());
}
}
else
{
string str = ;
if (() == ".c" || () == ".cpp" || () == ".h" || () == ".hpp" || () == ".cxx" || () == ".cs")
{
try
{
FileStream fin = new FileStream(
, , );
FileStream fout = new FileStream(
((), () + "\\Temp"), , );
StreamReader brin = new StreamReader(
fin, );
StreamWriter brout = new StreamWriter(
fout, );
string s = ();
while (s != null)
{
s = deleteComments(s); //Remove comments starting with //
(s); //Write it
(s); //Show on control
s = (); //Read in
}
(); // Close the connection between buffered read inflow and file read inflow.
();
}
catch (FileNotFoundException)
{
("File not found!");
}
catch (IOException e2)
{
(e2);
}
}
else
(, ((), () + "\\Temp"));
}
}
{
if (s == null) return s;
int pos = ("//");
if (pos < 0) return s;
return (0, pos);
}
if (("Temp"))
("Temp");
if ((""))
("");
if ((""))
("");
("Temp");
DirectoryInfo dir = new DirectoryInfo(".");
ArrayList folders = new ArrayList();
FileSystemInfo[] fileArr = ();
(fileArr);
for (int i = 0; i < ; i++)
{
FileInfo f = folders[i] as FileInfo;
if (f == null)
{
DirectoryInfo d = folders[i] as DirectoryInfo;
if (!("Debug") && !("Release") && !="Temp")
{
("Temp" + "\\" + );
(());
}
}
else
{
string str = ;
if (() == ".c" || () == ".cpp" || () == ".h" || () == ".hpp" || () == ".cxx" || () == ".cs")
{
try
{
FileStream fin = new FileStream(
, , );
FileStream fout = new FileStream(
((), () + "\\Temp"), , );
StreamReader brin = new StreamReader(
fin, );
StreamWriter brout = new StreamWriter(
fout, );
string s = ();
while (s != null)
{
s = deleteComments(s); //Remove comments starting with //
(s); //Write it
(s); //Show on control
s = (); //Read in
}
(); // Close the connection between buffered read inflow and file read inflow.
();
}
catch (FileNotFoundException)
{
("File not found!");
}
catch (IOException e2)
{
(e2);
}
}
else
(, ((), () + "\\Temp"));
}
}