|
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.
|
|
|
|
|
Hi,
How can I determin If I run on a 9x or a NT-based box?
I need to query some ugly registry keys that differe between the two...
Italian is a beautiful language. amare means to love, and amara bitter.
sighist | Agile Programming | doxygen
|
|
|
|
|
System.Environment.OSVersion.PlatformID != System.PlatformID.Win32NT
(use .NET SDK WinCV.exe to browse the CLR features by keyword (the resultset is often better and richer than the MSDN7's index)).
|
|
|
|