|
Because the installer didn't put the data file there. And neither should your program. If it needs to create data files it needs to put them in the correct place - and a subdirectory of Program Files isn't it.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Hai everybody,
Can you please tell me how to preserve the existing values in an array while re-dimensioning.
(In VB.Net we are having "Preserve" keyword)
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
M. J. Jaya Chitra wrote: Can you please tell me how to preserve the existing values in an array while re-dimensioning.
I presume you mean resizing.
Arrays are not resizable in C# (nor in VB.NET, incidentally. It is a trick to allow you to think they are resizable).
If you need a resizable array use something like an ArrayList
But, if you do need to make the array bigger then create a new one, copy the values over, and then change your existing references to the new array. The old one will drop out of scope and be picked up by the garbage collector.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Colin Angus Mackay wrote: use something like an ArrayList
Thank you for your solution
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
.NET 2 has an Array.Resize static method which behaves identically to the ReDim Preserve operation in VB. It only works for 1-dimensional arrays however. But unless you really need a proper array, one of the collections such as List<t> are probably better suited.
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
C++ to VB Converter: converts C++ to VB
Instant C++: converts C# to C++/CLI and VB to C++/CLI
Instant Python: converts C# to IronPython and VB to IronPython
|
|
|
|
|
Hi All,
I have a stored procedure that returns a dataset( which contains two tables).
I have to run the stored procedure a couple of times and need to keep the all the datasets.
Is is possible to merge the result of a new dataset in to previous one as many as i can?
dsnew.merge(dsold)
dsnew1.merge(dsnew)
dsnew2.merge(dsnew1) etc.........
so that i can have all the results of the datasets in Dsnew2
Thanks
|
|
|
|
|
|
Thanks very much,
My problem is when i merge one dataset with the previous one, the content of the previous dataset disapear.hence i only get one dataset which is the last merge operation.
I keeps loosing the prevoius merge operation.
Please if you can give me an example, on how i can retain the previous merge.
Thanks
|
|
|
|
|
I have a java script tagged to a asp image button server control , the java script fires and works perfectly in IE but not in firefox ,Any asumptions.
(I am .net 1.1 and and added the java script in code-behind using attributes)
Thanks In Advance
|
|
|
|
|
It would be great if you dont post duplicate post in our forum. thanks.
here is ur original post..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
I am Sorry for that i missed a word in the previous post so i posted again
Thanks In Advance
|
|
|
|
|
vamsimohan21 wrote: I am Sorry for that i missed a word in the previous post so i posted again
There is an edit modify link, for future reference!
-- modified at 7:59 Wednesday 4th July, 2007
|
|
|
|
|
Hi
Please help me to get time to first byte, for a web request using
HTTPWebResponse.
With Thanks,
Sakthi.
|
|
|
|
|
I have a java script tagged to a <asp:imagebutton> control , the java script fires and works perfectly in IE but not in firefox ,Any asumptions.
(I am .net 1.1 and and added the java script in code-behind using attributes)
Thanks In Advance
|
|
|
|
|
The javascript code is probably using some IE-specific functionality. Without showing the code it is 100% impossible to answer your question more fully.
|
|
|
|
|
Please show the code to us.. maybe. we might give some advices what you need to change in your code.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
I am sorry that i am in situation that I would not be able to expose the code, but the for all other controls in the same page in firefox java script works fine except for the image button control.
Thanks In Advance
|
|
|
|
|
vamsimohan21 wrote: I am sorry that i am in situation that I would not be able to expose the code,
I am sorry that I am in situation that I would not be able to answer the question.
(You can't honestly expect anyone to solve your coding issue without seeing the code, do you?)
|
|
|
|
|
Hi All,
i'm trying to implement animation in an app. The frame rate of the animation needs to be variable. To implement this, i have a thread which sleeps for 1/fps seconds, and when it wakes it invalidates the window. Then, the onpaint handler draws the next frame.
Whilst this approach works ok at low frame rates, when things speed up, the animation gets choppy (due to the way in which the message queue is processed).
Is there a better approach? I want to be able to draw at reasonably precise times. Would DirectDraw help? i've never looked at directx, but would be prepared to if it offered a solution to my problem.
Thanks
slip
|
|
|
|
|
Hi,
you may find some suggestions in my timer article...
|
|
|
|
|
Thanks, but I understand why the animation is jerky - the kernels scheduler runs on a similar timer to what you describe.
I'm just wondering how other apps which animate do it so smoothly - eg windows media player.
|
|
|
|
|
Hi,
I dont know how WMP does what it does. This comes to mind:
- use the right kind of timer
- use double-buffering
- make sure everything you need is in memory before you need it
- precalculate the next frame, so the only real-time thing to do is show it
- possibly work with thread priorities (not recommended if you are not familiar with it).
|
|
|
|
|
Hi Slip
I have recently worked on a solution that is similar to your needs. I used threads that animated a user control containing other controls, in fact I had multiple user controls being animated on the same form, with different threads.
I used delegates to access a number of variables on the form from my threads.
Also in the form I declared a volatile integer like this:-
private volatile int componentOnPaint
And a public method which will be used by a delegate to return the above value.
Then in your override method for OnPaint in the form, increment the componentOnPaint integer, this way you know how many times the form has been re-painted.
Before your thread has invalidated the form get the componentOnPaint value, invalidate the form and then sleep for a short time using Thread.Sleep(30) (this allows the thread to be re-painted). At the next line of execution check the componentOnPaint value again, if it is greater than before, then continue. Otherwise loop and sleep again, until the value is greater and the form is repainted. Then you would use Thread.Sleep again for a fixed time depending on the animations frame length.
To make the animation smoother, use another delegate to get the delay time (milliseconds) required in between animation cycles. Use DateTime.Now to get the time before you invalidated your form, and use DateTime.Now to get the time after componentOnPaint was greater.
Subtract the first value from last eg...
TimeSpan drawTime = AnimateLastStart - AnimateLastDrawn;
Then reduce your delay time by the time it took to refresh your form... ie...
<br />
Thread.Sleep(standardTime-drawTime.Milliseconds)
This worked for me, using volatile earlier means the variable can act as a semaphore accessible from any thread (hence volatile), so you know if the form has been drawn and you shouldn't miss any frames. The time manipulation should just make your animation smoother.
I hope this helps
Jason
-- modified at 7:04 Wednesday 4th July, 2007
|
|
|
|
|
I think you should first factor in how complicated is the animation you are trying to execute.
Drawing in .NET is not the fastest solution by any means, and usually its as slow as you can get. So your issue might be more related to .NET's drawing performance more than to timing issues...when you demand high frame rates maybe .NET's drawing performance just can't keep up more than the message queue not processing the paint messages (as a matter of fact Invalidate messages skip the application queue and are processed immeadiately, so queueing is not the issue).
For any kind of serious animation I would rely on DirectX or OpenGL. NET Drawing namespace does and adequate job when it comes to what it was meant to do, but animation was not in the list IMHO.
hope this helps
P.D.1: First off, before plunging into new technology, I'd try optimising the code. Even if .NET is slow, it might be enough in your case but maybe your drawing routines are not coded well enough. Make sure you are disposing all disposable objects you "own" in your drawing implementation, you're releasing correctly any unmanaged resources you might be using, etc. Also check if maybe its worthwhile to cache any of objetcs you might be using and that way avoid creating and releasing them on every drawn frame, etc.
P.D.2: If you have to rely on some other solution then you dont have to plunge into 100% native code...check out Managed DirectX.
-- modified at 4:42 Thursday 5th July, 2007
|
|
|
|
|
CODE:
<br />
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:8200/weboa/data.nsf/0/9212BC3EEF5F3B554825730E002B5C54?SaveDocument");<br />
request.Credentials = new NetworkCredential("admin", "password");<br />
request.Method = "POST";<br />
request.ContentType = "multipart/form-data; boundary=liubin_fengexian";<br />
request.Accept = "*/*";<br />
request.AllowWriteStreamBuffering = true;<br />
<br />
string sss = "--XXXXXXXX\r\n";<br />
sss += "Content-Dispostion: form-data; name=\"TestField\"\r\n";<br />
sss += "\r\n";<br />
sss += "AAAAAAAAAAAAAAAAAAA\r\n";<br />
sss += "--XXXXXXXX--\r\n";<br />
request.ContentLength = sss.Length;<br />
<br />
<br />
Stream s = request.GetRequestStream();<br />
<br />
byte[] b = Encoding.Default.GetBytes(sss);<br />
s.Write(b, 0, b.Length);<br />
s.Close();<br />
<br />
byte[] b2 = new byte[1024];<br />
WebResponse response = request.GetResponse();<br />
s = response.GetResponseStream();<br />
<br />
This code ERROR in
"WebResponse response = request.GetResponse();"
It said "HTTP server error:500 Internal server Error"
Why?
|
|
|
|