473,624 Members | 2,534 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Illegal Char error after illegal char's are removed.

110 New Member
I'm writing a program that a user loads a file (txt or csv) in which it reads newlines and commas as new object delimiters. Each new object is put into an array creating a new array object each time. There is also several tests in place to check the data being read into the program to return an error if there are characters that can't be used for a file or folder. There is an option to clean the data being read in which it will read a line of data, then run several replace statements on it to change illegal characters for safe characters. Somewhere in my code it is cleaning the data, replacing the illegal characters then trying to create files off the array objects but even though I've cleaned the data of illegal characters, upon creation, visual studio is spitting out its own error saying illegal characters (not the error I built as a test). Any ideas on why this might be are greatly appreciated. Bellow is the code in question.

Expand|Select|Wrap|Line Numbers
  1.  private void Runbtn_Click(object sender, EventArgs e)
  2.  
  3.         {//1
  4.             string[] lines = null; //create lines array
  5.  
  6.             using (StreamReader sr = new StreamReader(@newobject.csvDirectory))
  7.             {//2
  8.                 string fileContents = sr.ReadToEnd();
  9.                 lines = fileContents.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
  10.             }//2
  11.  
  12.             bool safeLength = true;
  13.  
  14.             if (Filebtn.Checked == true)
  15.             {//3                
  16.  
  17.                 for (int i = 0; i < lines.Length; i++)
  18.                 {//4
  19.                     if (lines[i].Length > MAXFILENAME)
  20.                     {//5
  21.                         newobject.fileNameError();
  22.                         safeLength = false;
  23.                         break;
  24.                     }//5
  25.  
  26.                 }//4
  27.  
  28.                 if (safeLength == true)
  29.                 {//4
  30.  
  31.                     if (cleancheckbox.Checked == true)
  32.                     { //5                                                           
  33.                         newobject.creationInProgress(); // prompts that files are being made                    
  34.  
  35.                         //create the child form
  36.                         newobject.ParentFolder = newfldrbx.Text;
  37.  
  38.                         // Specify a folder to house everything new inside
  39.                         //This is not the folder that holds the created files/folders
  40.                         // based off of csv/txt values
  41.                         string outputdir = folderBrowserDialog1.SelectedPath;
  42.  
  43.                         //Create a new subfolder under the current active folder
  44.                         // this new folder will hold all files/folders created
  45.                         // per project.
  46.                         string newPath = System.IO.Path.Combine(outputdir, newobject.ParentFolder);
  47.  
  48.                         // Create the subfolder
  49.                         System.IO.Directory.CreateDirectory(newPath);
  50.  
  51.                         for (int i = 0; i < lines.Length; i++)
  52.                         {//6
  53.                             lines[i] = newobject.cleanText(lines[i]); // sends data to get cleaned
  54.  
  55.  
  56.                             //takes the input from the new folder text box
  57.                             // and assigns it to the filename variable
  58.                             string fileName = lines[i] + ".txt";
  59.  
  60.                             // creates new file based off of file name input annd
  61.                             // parent directory
  62.                             string newFile = System.IO.Path.Combine(newPath, fileName);
  63.                             System.IO.File.Create(@newFile);
  64.                         }//6
  65.                     }//5
  66.  
  67.                     else if (cleancheckbox.Checked == false)
  68.                     {
  69.  
  70.                         // Return an error for file with illegal characters
  71.  
  72.                         bool linesOK = true;
  73.                         for (int i = 0; i < lines.Length; i++)
  74.                         {
  75.                             if (lines[i].IndexOfAny(illegal) != -1)
  76.                             {
  77.                                 newobject.illegalError();
  78.                                 linesOK = false;
  79.                                 break;
  80.                             }
  81.                         }
  82.  
  83.                         if (linesOK == true)
  84.                         {
  85.                             newobject.creationInProgress();
  86.  
  87.                             for (int i = 0; i < lines.Length; i++)
  88.                             {
  89.                                 // stores the string entered for the new folder name
  90.                                 newobject.ParentFolder = newfldrbx.Text;
  91.  
  92.                                 // Specify a folder to house everything new inside
  93.                                 //This is not the folder that holds the created files/folders
  94.                                 // based off of csv/txt values
  95.                                 string outputdir = folderBrowserDialog1.SelectedPath;
  96.  
  97.                                 //Create a new subfolder under the current active folder
  98.                                 // this new folder will hold all files/folders created
  99.                                 // per project.
  100.                                 string newPath = System.IO.Path.Combine(outputdir, newobject.ParentFolder);
  101.  
  102.                                 // Create the subfolder
  103.                                 System.IO.Directory.CreateDirectory(newPath);
  104.  
  105.                                 //takes the input from the new folder text box
  106.                                 // and assigns it to the filename variable
  107.                                 string fileName = lines[i] + ".txt";
  108.  
  109.                                 // creates new file based off of file name input annd
  110.                                 // parent directory
  111.                                 string newFile = System.IO.Path.Combine(newPath, fileName);
  112.                                 System.IO.File.Create(@newFile);
  113.                             }
  114.                         }
  115.                     }
  116.                 }
  117.             }
  118.  
  119.  
  120.             else if (folderbtn.Checked == true)
  121.             {
  122.                 if (cleancheckbox.Checked == true)
  123.                 {
  124.  
  125.  
  126.                     // Get the value to be passed
  127.                     string parentfolder = newfldrbx.Text;
  128.  
  129.                     //create the child form
  130.                     newobject.ParentFolder = parentfolder;
  131.  
  132.                     // Specify a "currently active folder"
  133.                     string outputdir = folderBrowserDialog1.SelectedPath;
  134.  
  135.                     //Create a new subfolder under the current active folder
  136.                     string newParent = System.IO.Path.Combine(outputdir, newobject.ParentFolder);
  137.  
  138.                     // Create the subfolder
  139.                     System.IO.Directory.CreateDirectory(newParent);
  140.  
  141.  
  142.                     for (int i = 0; i < lines.Length; i++)
  143.                     {
  144.                         lines[i] = newobject.cleanText(lines[i]);
  145.  
  146.                         //Create a new subfolder under the current active folder
  147.                         string newChild = System.IO.Path.Combine(newParent, lines[i]);
  148.  
  149.                         // Create the subfolder
  150.                         System.IO.Directory.CreateDirectory(newChild);
  151.                     }
  152.  
  153.                     newobject.creationInProgress();
  154.                 }
  155.  
  156.                 else if (cleancheckbox.Checked == false)
  157.                 {
  158.  
  159.  
  160.                     // Return an error for file with illegal characters
  161.                     bool linesOK = true;
  162.                     for (int i = 0; i < lines.Length; i++)
  163.                     {
  164.                         if (lines[i].IndexOfAny(illegal) != -1)
  165.                         {
  166.                             newobject.illegalError();
  167.                             linesOK = false;
  168.                             break;
  169.                         }
  170.                     }
  171.  
  172.                     // if the file chosen has no illegal characers this this set of
  173.                     // commmands occurs
  174.                     if (linesOK == true)
  175.                     {
  176.  
  177.                         // Get the value to be passed
  178.                         string parentfolder = newfldrbx.Text;
  179.  
  180.                         //create the child form
  181.                         newobject.ParentFolder = parentfolder;
  182.  
  183.                         // Specify a "currently active folder"
  184.                         string outputdir = folderBrowserDialog1.SelectedPath;
  185.  
  186.                         //Create a new subfolder under the current active folder
  187.                         string newParent = System.IO.Path.Combine(outputdir, newobject.ParentFolder);
  188.  
  189.                         // Create the subfolder
  190.                         System.IO.Directory.CreateDirectory(newParent);
  191.  
  192.                         for (int k = 0; k < lines.Length; k++)
  193.                         {
  194.                             //Create a new subfolder under the current active folder
  195.                             string newChild = System.IO.Path.Combine(newParent, lines[k]);
  196.  
  197.                             // Create the subfolder
  198.                             System.IO.Directory.CreateDirectory(newChild);
  199.  
  200.                         }
  201.                         // this lets the user know the folders were made
  202.                         // and must lie outside of the loops to only iterate
  203.                         // one time
  204.                         newobject.creationInProgress();
  205.  
  206.                     }
  207.                 }
  208.             }
  209.             }
  210.  
and here is the replace statement:
Expand|Select|Wrap|Line Numbers
  1.     public string cleanText(string c)
  2.     {
  3.         string cleanText = c.Replace("/", "-");
  4.         string cleanText2 = cleanText.Replace("\\", "-");
  5.         string cleanText3 = cleanText2.Replace(":", "-");
  6.         string cleanText4 = cleanText3.Replace("?", "-");
  7.         string cleanText5 = cleanText4.Replace("*", "-");
  8.         string cleanText6 = cleanText5.Replace("|", "-");
  9.         string cleanText7 = cleanText6.Replace("\"", "");
  10.  
  11.  
  12.         return cleanText7;
  13.     }
  14.  
Thanks for everyones help on this.
Jul 27 '10 #1
15 3599
JKing
1,206 Recognized Expert Top Contributor
What is the value of the string newFile?
Jul 28 '10 #2
Fuzz13
110 New Member
The user types in a text box a name of a folder (this folder is not one that exists but rather one that will be made)
The name typed in is stored as value "newobject.Pare ntFolder"
Next the user will browse to an already existing folder from which to work from (i.e. My Documents)
The directory name of the folder they browsed to is stored as "outputdir"
The next step is that the program combines the outputdir (directory name of browsed to folder) with the to-be-created folder "parentfold er"
This combination of "outputdir" and "parentfold er" is then stored as "newPath"
The program then builds the users new folder (the folder for the given project) in this line of code:
Expand|Select|Wrap|Line Numbers
  1. System.IO.Directory.CreateDirectory(newPath);
  2.  
Next there is a for loop that will continue for every item within the given array (the array's length is determined earlier in the code when the file selected is read in line by line)

Then I have each object in the array add the extension ".txt" here:
Expand|Select|Wrap|Line Numbers
  1. string fileName = lines[i] + ".txt";
  2.  
as you can see the new "object[i].txt"
is stored as "fileName" (fileName is reassigned with each iteration of the for loop to accommodate the next object of the array.
This shouldn't be an issue as the file is being created before restarting the beginning of the for loop and reassigning the value "fileName")

Finally there is the newFile value you asked about.
"newFile" is stored as a combination of "newPath" (i.e. combination of "outputdir" and "parentfold er") and "fileName" (i.e. object[i].txt)

So for each "newFile" it should be creating either a file or a folder (based off a selection within the program)
the file/folder will be named based off the name of the currently read object of the array, and created inside the folder name
the user types in to create (a folder not in existence) and that folder will be created within a selected directory (i.e. My Documents)

That was a very long answer to your question but I think it was necessary since newFile is based off a lot of other combinations.

Thanks for your help.
Jul 28 '10 #3
JKing
1,206 Recognized Expert Top Contributor
That still doesn't answer my question. I understand your logic in building the string newFile based off user-input and other variables. That is all fine and dandy but I want to know the value of the string before the error occurs. I am assuming the error is occurring on one of the following lines:
Expand|Select|Wrap|Line Numbers
  1. System.IO.File.Create(@newFile);
If this is the case I want to know the value of newFile when the error occurred. This will help hint as to what is going on.
Jul 28 '10 #4
Fuzz13
110 New Member
Ah. I totally misunderstood. The file being loaded appears as such:
Expand|Select|Wrap|Line Numbers
  1. first line is safe
  2. 2nd line has ** illegal char
  3. third line is safe
  4. ** oh no
  5. hello // goodbye
  6. "try this"
  7. \and this?
  8.  
The weird thing is any line by itself is running fine for example:

"This sentence needs fixed***"

the program will either fail my test in place and give an error (one of mine) or if the user chooses to replace illegal characters it will create the file/folder named:

"This sentence needs fixed---"

Hope that was the appropriate answer to your question.
Jul 28 '10 #5
JKing
1,206 Recognized Expert Top Contributor
Okay you are missing what I mean.

Expand|Select|Wrap|Line Numbers
  1.  
  2.  private void Runbtn_Click(object sender, EventArgs e)
  3.  
  4.         {//1
  5.             string[] lines = null; //create lines array
  6.  
  7.             using (StreamReader sr = new StreamReader(@newobject.csvDirectory))
  8.             {//2
  9.                 string fileContents = sr.ReadToEnd();
  10.                 lines = fileContents.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
  11.             }//2
  12.  
  13.             bool safeLength = true;
  14.  
  15.             if (Filebtn.Checked == true)
  16.             {//3                
  17.  
  18.                 for (int i = 0; i < lines.Length; i++)
  19.                 {//4
  20.                     if (lines[i].Length > MAXFILENAME)
  21.                     {//5
  22.                         newobject.fileNameError();
  23.                         safeLength = false;
  24.                         break;
  25.                     }//5
  26.  
  27.                 }//4
  28.  
  29.                 if (safeLength == true)
  30.                 {//4
  31.  
  32.                     if (cleancheckbox.Checked == true)
  33.                     { //5                                                           
  34.                         newobject.creationInProgress(); // prompts that files are being made                    
  35.  
  36.                         //create the child form
  37.                         newobject.ParentFolder = newfldrbx.Text;
  38.  
  39.                         // Specify a folder to house everything new inside
  40.                         //This is not the folder that holds the created files/folders
  41.                         // based off of csv/txt values
  42.                         string outputdir = folderBrowserDialog1.SelectedPath;
  43.  
  44.                         //Create a new subfolder under the current active folder
  45.                         // this new folder will hold all files/folders created
  46.                         // per project.
  47.                         string newPath = System.IO.Path.Combine(outputdir, newobject.ParentFolder);
  48.  
  49.                         // Create the subfolder
  50.                         //System.IO.Directory.CreateDirectory(newPath);
  51.                         MessageBox.Show(newPath);
  52.  
  53.                         for (int i = 0; i < lines.Length; i++)
  54.                         {//6
  55.                             lines[i] = newobject.cleanText(lines[i]); // sends data to get cleaned
  56.  
  57.  
  58.                             //takes the input from the new folder text box
  59.                             // and assigns it to the filename variable
  60.                             string fileName = lines[i] + ".txt";
  61.  
  62.                             // creates new file based off of file name input annd
  63.                             // parent directory
  64.                             string newFile = System.IO.Path.Combine(newPath, fileName);
  65.                             //System.IO.File.Create(@newFile);
  66.                             MessageBox.Show(newFile);
  67.                         }//6
  68.                     }//5
  69.  
  70.                     else if (cleancheckbox.Checked == false)
  71.                     {
  72.  
  73.                         // Return an error for file with illegal characters
  74.  
  75.                         bool linesOK = true;
  76.                         for (int i = 0; i < lines.Length; i++)
  77.                         {
  78.                             if (lines[i].IndexOfAny(illegal) != -1)
  79.                             {
  80.                                 newobject.illegalError();
  81.                                 linesOK = false;
  82.                                 break;
  83.                             }
  84.                         }
  85.  
  86.                         if (linesOK == true)
  87.                         {
  88.                             newobject.creationInProgress();
  89.  
  90.                             for (int i = 0; i < lines.Length; i++)
  91.                             {
  92.                                 // stores the string entered for the new folder name
  93.                                 newobject.ParentFolder = newfldrbx.Text;
  94.  
  95.                                 // Specify a folder to house everything new inside
  96.                                 //This is not the folder that holds the created files/folders
  97.                                 // based off of csv/txt values
  98.                                 string outputdir = folderBrowserDialog1.SelectedPath;
  99.  
  100.                                 //Create a new subfolder under the current active folder
  101.                                 // this new folder will hold all files/folders created
  102.                                 // per project.
  103.                                 string newPath = System.IO.Path.Combine(outputdir, newobject.ParentFolder);
  104.  
  105.                                 // Create the subfolder
  106.                                 //System.IO.Directory.CreateDirectory(newPath);
  107.                                 MessageBox.Show(newPath);
  108.  
  109.                                 //takes the input from the new folder text box
  110.                                 // and assigns it to the filename variable
  111.                                 string fileName = lines[i] + ".txt";
  112.  
  113.                                 // creates new file based off of file name input annd
  114.                                 // parent directory
  115.                                 string newFile = System.IO.Path.Combine(newPath, fileName);
  116.                                 //System.IO.File.Create(@newFile);
  117.                                 MessageBox.Show(newFile);
  118.                             }
  119.                         }
  120.                     }
  121.                 }
  122.             }
  123.  
  124.  
  125.             else if (folderbtn.Checked == true)
  126.             {
  127.                 if (cleancheckbox.Checked == true)
  128.                 {
  129.  
  130.  
  131.                     // Get the value to be passed
  132.                     string parentfolder = newfldrbx.Text;
  133.  
  134.                     //create the child form
  135.                     newobject.ParentFolder = parentfolder;
  136.  
  137.                     // Specify a "currently active folder"
  138.                     string outputdir = folderBrowserDialog1.SelectedPath;
  139.  
  140.                     //Create a new subfolder under the current active folder
  141.                     string newParent = System.IO.Path.Combine(outputdir, newobject.ParentFolder);
  142.  
  143.                     // Create the subfolder
  144.                     //System.IO.Directory.CreateDirectory(newParent);
  145.                     MessageBox.Show(newParent);
  146.  
  147.  
  148.                     for (int i = 0; i < lines.Length; i++)
  149.                     {
  150.                         lines[i] = newobject.cleanText(lines[i]);
  151.  
  152.                         //Create a new subfolder under the current active folder
  153.                         string newChild = System.IO.Path.Combine(newParent, lines[i]);
  154.  
  155.                         // Create the subfolder
  156.                         //System.IO.Directory.CreateDirectory(newChild);
  157.                         MessageBox.Show(newChild);
  158.                     }
  159.  
  160.                     newobject.creationInProgress();
  161.                 }
  162.  
  163.                 else if (cleancheckbox.Checked == false)
  164.                 {
  165.  
  166.  
  167.                     // Return an error for file with illegal characters
  168.                     bool linesOK = true;
  169.                     for (int i = 0; i < lines.Length; i++)
  170.                     {
  171.                         if (lines[i].IndexOfAny(illegal) != -1)
  172.                         {
  173.                             newobject.illegalError();
  174.                             linesOK = false;
  175.                             break;
  176.                         }
  177.                     }
  178.  
  179.                     // if the file chosen has no illegal characers this this set of
  180.                     // commmands occurs
  181.                     if (linesOK == true)
  182.                     {
  183.  
  184.                         // Get the value to be passed
  185.                         string parentfolder = newfldrbx.Text;
  186.  
  187.                         //create the child form
  188.                         newobject.ParentFolder = parentfolder;
  189.  
  190.                         // Specify a "currently active folder"
  191.                         string outputdir = folderBrowserDialog1.SelectedPath;
  192.  
  193.                         //Create a new subfolder under the current active folder
  194.                         string newParent = System.IO.Path.Combine(outputdir, newobject.ParentFolder);
  195.  
  196.                         // Create the subfolder
  197.                         //System.IO.Directory.CreateDirectory(newParent);
  198.                         MessageBox.Show(newParent);
  199.  
  200.                         for (int k = 0; k < lines.Length; k++)
  201.                         {
  202.                             //Create a new subfolder under the current active folder
  203.                             string newChild = System.IO.Path.Combine(newParent, lines[k]);
  204.  
  205.                             // Create the subfolder
  206.                             //System.IO.Directory.CreateDirectory(newChild);
  207.                             MessageBox.Show(newChild);
  208.  
  209.                         }
  210.                         // this lets the user know the folders were made
  211.                         // and must lie outside of the loops to only iterate
  212.                         // one time
  213.                         newobject.creationInProgress();
  214.  
  215.                     }
  216.                 }
  217.             }
  218.             }
  219.  
  220.  
Copy your current code and paste it into a text file and save it for a backup.
Now copy this code paste it in and run your program. Enter some values for the folder names and tell me what the messageboxes say.
Jul 28 '10 #6
JKing
1,206 Recognized Expert Top Contributor
What I am trying to get you to see is that your variable newFile and/or newPath may not contain the data that you think they do...

I don't have access to VS at the moment but I am fairly certain that the file dialog selected path returns the path with a \ at the end. Use that with the Path.Combine method and you now have a \\ in your string. The @ symbol on newFile says to take it literally and this will give you your illegal character error.
Jul 28 '10 #7
Fuzz13
110 New Member
I'm getting the same error as before: Illegal character

Here's the details:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Argument Exception: Illegal characters in path.
at System.IO.Path. CheckInvalidPat hChars(String path)
at System.IO.Path. Combine(String path1, String path2)
at WindowsFormsApp lication1.Form1 .Runbtn_Click(O bject sender, EventArgs e) in C:\Users\Dahlia \Desktop\CSV program\Form1.c s:line 137
at System.Windows. Forms.Control.O nClick(EventArg s e)
at System.Windows. Forms.Button.On Click(EventArgs e)
at System.Windows. Forms.Button.On MouseUp(MouseEv entArgs mevent)
at System.Windows. Forms.Control.W mMouseUp(Messag e& m, MouseButtons button, Int32 clicks)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.ButtonBas e.WndProc(Messa ge& m)
at System.Windows. Forms.Button.Wn dProc(Message& m)
at System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)
at System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
WindowsFormsApp lication1
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Dahlia/Desktop/CSV%20program/WindowsFormsApp lication1/WindowsFormsApp lication1/bin/Release/WindowsFormsApp lication1.exe
----------------------------------------
System.Windows. Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows. Forms/v4.0_4.0.0.0__b 77a5c561934e089/System.Windows. Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b 03f5f7f11d50a3a/System.Drawing. dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b 77a5c561934e089/System.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b 77a5c561934e089/System.Xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config ) must have the
jitDebugging value set in the system.windows. forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuratio n>
<system.windows .forms jitDebugging="t rue" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Jul 29 '10 #8
JKing
1,206 Recognized Expert Top Contributor
Your string variable outputdir ends with a \, when you try to use it in the Path.Combine method it throws the illegal character error.
Jul 29 '10 #9
Fuzz13
110 New Member
If the outputdir ends with a \ wouldn't it always give me an illegal character error then? I can get the program to run if it is loading a file with only a single line of text.
Jul 29 '10 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

6
15079
by: Sean Bartholomew | last post by:
i have a bit of a problem. im parsing a record string using strtok but im encountering back to back whitespaces (\t\t) due to empty fields from my database export. the STRTOK function reads up to the LAST \t in a consecutive arrangement. this of course skews my fields offsetting them. annoying.... yes. however i may have 2 solutions: 1----if i can replace all instances of "\t\t" with "\t \t" or anything other than space. id be happy.
16
2413
by: drj0nson | last post by:
What is the right way of creating a string/char array and assigning to a char* which is then used in a function call. Thought it would be quite nice to avoid a memory leakage /core dump. 1 Header with char* x 2 Class includes header 3 In Class member function I want to : a)conditionally create a string ie populate x
2
3390
by: Alvin Bruney | last post by:
Anybody know how to fix this. Currently only a reboot will cure it. I'm sick and fed up of rebooting. It has to be one of these services running in the background doing this. It can happen with any assembly, .Net included. It's intermittent. I've tried. Re-opening VS studio, re-starting IIS, re-starting application pool. Killing all the w3wp.exe processes. Nothing seems to work except a reboot. Deleting temporary internet files. This is...
12
2521
by: mast2as | last post by:
Hi everyone... I have a TExceptionHandler class that is uses in the code to thow exceptions. Whenever an exception is thrown the TExceptionHander constructor takes an error code (int) as an argument. I was hoping to create a map<int, const char*that would be used in the showError member function of the TExceptionHandler class where the key (int) would be the error code and const char* the message printed out to the console. My question...
2
2749
by: dasilva109 | last post by:
Hi guys I am new to C++ and need urgent help with this part of my code for a uni coursework I have to submit by Thursday //ClientData.h #ifndef CLIENTDATA_H #define CLIENTDATA_H #include <string>
0
1370
by: devmentee | last post by:
Hi All, I am compiling a VS2003 mixed mode C++ DLL under VS2005 and I get the following linker error. I am using STL map inside a C++ class which is compiled as a mixed mode DLL. I have removed /NOENTRY and /Zl switches and tried compiling with msvcrt.lib, however I still get the error below. Any help will be much much appreciated...Many Thanks
21
6871
by: one2001boy | last post by:
PostMessage() function returns ERROR_NOT_ENOUGH_QUOTA after running in a loop for 700 times, but the disk space and memory are still big enough. any suggestion to resolve this problem? thanks.
3
3525
by: Tarik Monem | last post by:
Hi Everyone, Still a newbie with FLEX, and I've passed arrays using AJAX to FLEX before, but I've never passed links to FLEX. Basically, this is the OUTPUT, which I wanted, but I'm given an error of "illegal character," from the JavaScript console: Error: illegal character Source Code:
11
2920
by: Dennis Jones | last post by:
Hi all, 1) Let's say you have two char 's of the same size. How would you write a no-fail swap method for them? For example: class Test { char s; void swap( Test &rhs ) {
13
3731
by: Hongyu | last post by:
Hi, I have a datetime char string returned from ctime_r, and it is in the format like ""Wed Jun 30 21:49:08 1993\n\0", which has 26 chars including the last terminate char '\0', and i would like to remove the weekday information that is "Wed" here, and I also would like to replace the spaces char by "_" and also remove the "\n" char. I didn't know how to truncate the string from beginning or replace some chars in a string with another...
0
8168
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8672
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8614
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7153
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4075
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4167
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2603
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1474
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.