|
Maybe I'm missing something, but do you need the quotes at all (i.e. do any of the strings contain embedded commas)? If not then why not remove all the quotes first (using Replace), then use Split to break up the line on the commas?
If the strings can contain embedded commas then it's harder. You say that it "throws in extra quotes whenever it wants", but then in your example its actually omitted a quote as well (between 'test' and the comma immediately after it). Does this really happen or was this an error in the example? Also, can it really add extra quotes "anywhere" (including in the middle of the text strings), or does it simply replace one quote by one or more quotes? Knowing the exact nature of the problem would help in trying to find a solution.
Chris Jobson
|
|
|
|
|
I want to remove all of the quotes, thats my goal. I have also tried using the replace function with both character and string overloads, but it doesnt seem to work, Im fairly new to c# so I apoligize for any newbie questions in advance. I was attempting to do something similar to this, string.replace(", null) or string.replace(char [] {'"'}, null), and I had no luck. If someone could give me directions on how to remove quotes or tick marks from a string my problem would be solved. Thanks for your patience.
Ryan
|
|
|
|
|
String.Replace("\"", null);
|
|
|
|
|
s.Replace("\"", "")
will remove all the double-quote characters in s.
Chris Jobson
|
|
|
|
|
String.Replace("\"", null);
|
|
|
|
|
|
|
Hi All
How can I check if an application is running or not and close it if it is running from my C# app?
|
|
|
|
|
Take a look at Management namespace and search this site for it.You can get list of running process with this namespace.There is an article about it in CP.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
ya I got it, thanks a lot man
|
|
|
|
|
I have tackled similar problem in VB using API
EnumWindows
GetClassName
|
|
|
|
|
|
When I create a form inside another form,it show it as "Modal" dialog.(Like DoModal() in MFC).How can I change this behaviour so when I create second form ,user can click and use first form ?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Use Form.Show() instead of Form.ShowDialog() - it should be as simple as that
--
Russell Morris
"Have you gone mad Frink? Put down that science pole!"
|
|
|
|
|
Thanks.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Hello,
I'm actually working on a XML file editor. I actually can import XML files in a treeView, edit nodes and so on. I'd like to be able to save the modifications i'v done in my treeview to export it as an xml file. Do you know how to parse a treeView, and serialize it to save the result in a xml file ?
Thank you and long life to thecodeproject.com !
julien
|
|
|
|
|
A present is waiting for you on the home page.
|
|
|
|
|
Hi!
Can somebody send to me code of GUI thread written in C#?
How correctly stop bckground thread?
For current moment I found only such solution, but it often raise strange Exceptions...
I use such code in async progress dialog... but at moment when I say progress form to Finish his work it can raise to me exception, like:
************** Exception Text **************
System.Threading.ThreadAbortException: Thread was being aborted.
at System.Windows.Forms.UnsafeNativeMethods.SetFocus(IntPtr hWnd)
at System.Windows.Forms.ContainerControl.FocusActiveControlInternal()
at System.Windows.Forms.Form.set_Active(Boolean value)
at System.Windows.Forms.Form.WmActivate(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
<br />
public void AsyncShow()<br />
{<br />
if( m_guiThread == null )<br />
{<br />
ThreadStart start = new ThreadStart( BackgroundGUIThread );<br />
m_guiThread = new Thread( start );<br />
m_guiThread.Start();<br />
}<br />
}<br />
<br />
public void Finish()<br />
{<br />
try<br />
{<br />
this.Hide();<br />
<br />
m_guiThread.Abort(); <br />
m_guiThread.Join();<br />
}<br />
catch( Exception exc )<br />
{ <br />
Trace.WriteLine( exc.Message + "\r\n" + exc.StackTrace, "PrgDlg Exception" );<br />
}<br />
}<br />
<br />
private void BackgroundGUIThread()<br />
{<br />
Thread.CurrentThread.Name = "Background GUI MsgLoop Thread";<br />
<br />
try<br />
{<br />
this.Show();<br />
<br />
MSG msg = new MSG();<br />
<br />
while( WindowsAPI.GetMessage( ref msg, 0, 0, 0 ) )<br />
{<br />
WindowsAPI.TranslateMessage( ref msg );<br />
WindowsAPI.DispatchMessage( ref msg );<br />
}<br />
}<br />
finally<br />
{<br />
try<br />
{<br />
this.Close();<br />
}<br />
catch<br />
{<br />
}<br />
<br />
Trace.WriteLine( "Quit thread" );<br />
}<br />
}<br />
Good Luck
Alex Kucherenko
|
|
|
|
|
|
Thanks...
Not realy what I expect, but it can work without strange exceptions
Good Luck
Alex Kucherenko
|
|
|
|
|
Anyone know how to burn CD's using C#?? Does MS have an .NET or API for this? Thanks!
|
|
|
|
|
Its called IMAPI. Its based on COM. You might have to write a wrapper for .NET. I remember seeing a sample using this API on www.gotdotnet.com. Check under C++ Samples.
|
|
|
|
|
Yeah I did do a little research about IMAPI. Unfortunately, I know ZERO C++ and I'm dissapointed in the fact that CD Burning Classes were not introduced into the .NET Framework. WindowsXP has had built in burning for a while. Hopefully they'll add it with .NET 2.0.
|
|
|
|
|
I would like to access a legacy ms sql 6.5 database from a c# application. When I execute the connect method, it tells me only 7.0 and above are supported. Does anyone know a way around this?
|
|
|
|
|
Use ODBC.NET instead of the pseudo-native SQLServer .NET data provider.
|
|
|
|