|
Sure there other problems out there but the tool I wrote needs 15 seconds to startup.
(You might ask what takes so long. It's mostly Windows Forms inits and updates .)
I am talking about warm start - which means the app has been run before. Cold start takes even longer.
That is not acceptable for a repeatedly used tool. Using NGEN the startup time was reduced to under 5 seconds.
That means a much better user experience.
|
|
|
|
|
No, JIT-compiling does not replace or update the native image if it got invalid.
If I start the app and the image is invalid the app is jit-compiled. But that does not update the image.
Thus the app will always be jit compiled till someone updates the native image.
A launcher app is not possible because it would cost additional time - which I want to save.
I thought about automatically updating the image when closing the app.
Because:
* This will not add to my startup time.
* The exe-file CAN be installed by NGEN while it is running. (I tried it.)
* If the native image is invalid the application will still run (but startup slower).
|
|
|
|
|
When parsing a string that contains a date with DateTime.Parse, how can you get the custom DateTime format string that describes the format the string was in? (i.e. "M/d/yyyy" or "M/d/yy", etc.)
|
|
|
|
|
Are you saying that you want to get the format string from an already existing date, like "03/05/2009"??
First, there is no method you can call that will return this. Second, the reason being is in the example I just gave? Is that date March 5th or is it May 3rd?? It's impossible to tell unless the source of the date can be interrogated somehow.
|
|
|
|
|
Yes, but you can assume that the string has already "succesfully" been parsed with DateTime.Parse.
Supposedly DateTime.Parse decides which value is the month by using the culture-specific format information in the IFormatProvider argument. (Of course you can never be sure that that same month-day order was actually intended in the string).
Anyway, if Parse can return a DateTime then the format string is also known. It would be useful to have for instance for later calls to DateTime.ParseExact to see if other strings also follow that same format.
|
|
|
|
|
Like Luc said, it's in the CultureInfo. I thought you're original post said that you wanted to derive the format string from the Date string itself.
|
|
|
|
|
Maybe CultureInfo.DateTimeFormat can help you?
|
|
|
|
|
By default when you add output to Application folder, it copies exe and dependencies (DLLs) in the same folder. I want to copy DLLs in separate folder named "Bin". I was unable to find any solution on this. Can anyone help me...?
|
|
|
|
|
Considering your code has to be modified to allow it to find .DLL files outside of the folder the .EXE was launched from or other than any folder in the PATH, this isn't a good idea.
The Setup and Deployment Wizard does not account for this type of setup. You'd have to customize one by hand in order to do what you want. Personally, I don't use the Setup and Deployment projects in Visual Studio. I use external third party tools, like InnoSetup and Wise Package Studio to create my installers.
|
|
|
|
|
I found it's resolution.
We need to modify App.config to locate DLLs on runtime. We need to write following in App.config under <runtime> configuration element. The following code snippet will tell your exe to get DLLs from "Bin" folder which is located in the same folder where EXE are placed.
<assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatepath="Bin">
Regards,
Wasif Ahmad
Microsoft Certified Professional.
|
|
|
|
|
how to capture image and store in a folder.
tell me the code of that. its in vb.net 2008..
|
|
|
|
|
This site doesn't just hand over code to anyone who asks. We help people write their own code. We will not write it for you.
Capture an image from what device?? Scanner, camera, webcam, Vulcan Mind Meld, ...???
|
|
|
|
|
CapturedImage.Save("Image file path")
The image capture is up to you. Try interfacing with an IP camera or digital camera
|
|
|
|
|
how to prepare application setup in vb.net?
|
|
|
|
|
You can either add a Setup and Deployment project to your solution, or you can use a third-party tool like InnoSetup, Wise Package Studio, InstallShield, or whatever. The steps for creating an installation are long and varied depending on what your setup has to do. This explanation will not fit in a couple of forum posts.
|
|
|
|
|
how to add ms-word in vb.net?
it should open after we click a button.
|
|
|
|
|
Use the <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx">Process</a>[<a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx" target="_blank" title="New Window">^</a>] class. There's a VB.NET example on that same page
I are troll
|
|
|
|
|
|
|
Hello All...
Do U know how to work with Group Policy in C#.
Any Samples or Docs...?
Thx 4 reading
Enjoy...
Siddharth
|
|
|
|
|
Hi
Been working with C# a lot, but strangely enough, not very much with threading. I guess my question in someway touches that area.
My problem is the following. I want to perform a series of tasks with a single webbrowser. Each task should consist of the following: 1. Load a document from the internet, 2. Analyze the document and store some data.
To do these things for each task is no problem. However, as a series of tasks is queued, some trouble occurs. To load a document I use the Url property of the webbrowser, and the code to analyze it is placed in a method being executed when the DocumentCompleted event is fired. This is placed within a class called BrowserTask. To perform a task, BrowserTask's Perform method is called. This method sets the Url of the browser. However, the method call is ended when this is done - which is not what I want. I want the method call to end after the document has been completed (and analyzed), meaning it should wait for DocumentCompleted event.
Seems like a simple task to me, however i have googled my ass of trying to find a solution to this problem, without finding anything helpful.
Help would be very appreciated.
Thanks!
|
|
|
|
|
Hi,
just like all "completed" and "received" handlers, DocumentCompleted executes on a separate thread.
So you could use an AutoResetEvent() and apply a WaitOne() which keeps your business logic from running ahead; then have a Set() in the DocumentCompleted handler, allowing your logic to continue.
I foresee one major problem though: I have experienced DocumentCompleted is not trustworthy, a web page may call other (sub)documents and some or all of them fire DocumentCompleted, so you will have to see if that happens, and try and figure out a way to determine the entire page has loaded...
Maybe you don't need to see the WebBrowser control, and you then could consider, as a last resort, to create a new one after every (problematic) page.
|
|
|
|
|
Thank you Luc!
I couldn't figure out how to use an AutoResetEvent though. However, I found the following solution, which seems to work:
WebBrowser browser = new WebBrowser();
bool loaded = false;
browser.DocumentCompleted += delegate { MessageBox.Show("loaded!"); loaded = true; };
browser.Navigate("http://www.facebook.com/", false);
while (!loaded)
Application.DoEvents();
Maybe not a very nice one? How would i use an AutoResetEvent instead?
Thanks /Viktor
|
|
|
|
|
your while loop is keeping an entire core busy, not a nice thing to do.
AutoResetEvent, just like all .NET classes, is documented in MSDN.
The first page on the topic contains an appropriate example in the Calculate class.
|
|
|
|
|
Luc Pattyn wrote: your while loop is keeping an entire core busy, not a nice thing to do.
True. But with a simple modification this solution might still be enough:
while (!loaded) { Thread.Sleep(100); Application.DoEvents(); }
Obviously this means an average latency of half the sleep interval between the loading completing and the thread continuing, but it will not use a lot of resources (provided a relatively long interval like 0.1 seconds). Threads normally go to sleep and wake up rather more often.
You may already know this, but you also don't *need* to call Application.DoEvents() in order for this to work. You DO however need to call it if you want the application to remain responsive while this is going on. Also, if you use an autoreset like Luc suggested this will put the main window thread to sleep and thus result in an unresponsive user interface until the loading completes. Depending on whether this is some tool you will use yourself or something pushed to actual users this may be acceptable some of the time, but I would think you'd find it unacceptable once there's a network problem or the server you contact just doesn't respond for a long time.
|
|
|
|