|
Y..es... I understood that much.
But I need to input, not output... I need to get the colours, not set them...
Anyway, I got an algorithm to use for RGB to CMYK conversion. I was hoping to find some built-in stuff, but I guess it'll do
|
|
|
|
|
I have a tuff question, and ill give anyone my first born child for an answer. Im reading a comma delimited text file. So i have strings that I read in that look like this, "test", "test2", "test3", well here is my problem. The file gets screwed up from time to time and throws in extra quotes whereever it wants. So I often get this ""test, """"test2"", .
Im using the split function with a string array to split the line when i read it in, but i need to know how to remove those damn quotes from the strings. I have tried using the trim function and the replace function to no avail. Any help would be greatly appreciated.
Thanks,
Ryan
|
|
|
|
|
Instead of trimming, I would try to find why the extra quotes get in the file. How do you produce the file, how do you read it? Do you have code samples to show?
|
|
|
|
|
Well that is part of the problem. This is an add on to an already released product, and they have no intention of fixing the issue with the current product, some Im stuck with what it gives me.
|
|
|
|
|
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!
|
|
|
|