|
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.
|
|
|
|
|
If the code you have posted is on the main UI thread (and it should be as otherwise you should not call Application.DoEvents ), the problem with using an AutoResetEvent or Monitor.Wait and Monitor.Pulse is that it will put the UI thread to sleep until the operation completes and thus produce a very unpleasant unresponsive application. It won't cause the application to crash, but it will seem like it has if a network problem occurs or a server is very slow to respond.
The question is why do you need any synching at all? The WebBrowser already provides a mechanism in the form of the event, so if step one is to download a document and step 2 is to scrape it, then why not just call scrape() from within the completed handler?
There is at least one problem with this though; it's a bit tedious to update the UI from threads other than the main UI thread, because you have to marshal the calls using Control.Invoke . It's not difficult but it is a bit ugly.
|
|
|
|
|
Hi,
if you don't need to see the web page, you should not use a WebBrowser at all; just use the HttpRequest class.
[EDIT] That will give you the page you ask for without loading all the referenced objects, such as images.
[/EDIT]
modified on Thursday, April 16, 2009 8:00 AM
|
|
|
|
|
Hi Guys,
I'm having problem with getting my TreeView check boxes working as intended. I've got a set of root nodes for Groups, and all child elements belong to that group. I'm only interested in enabling check changing for child items, and changing the group check state should be prevented.
I have overrided the OnBeforeCheck and OnAfterCheck to perform the desired bahviour, However, by double clicking on an unchecked check box, the check state is changed, and i get nothing in either OnDoubleClick, OnNodeDoubleClick and no Before/After check events. The OnDoubleClick and OnNodeDoubleClick are raised when going from Checked to Unchecked.
Ideally i'd like to disable or hide the 'group' node check boxes
Does anyone have a solution for this?
Regards
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
The only thing I can think of that might work is to override the two doubleclick event handlers and test for the Level of the node, passed in the eventargs, if Level == 1 (or whatever), return, otherwise do base.onWhatever. THis of course will only work if all of your 'group' nodes are at the same level.
It would look something like:
private override void OnDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
if (e.Node.Level == 1)
{
return;
}
base OnDoubleClick(sender, e);
}
Hope this helps.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi Henry,
Thanks for the reply, but i've tried overriding the OnDoubleClick and OnNodeDoubleClick and neither of them are called when double clicking a node, except when going from checked to unchecked.
I will see if i can make it reproducable and submit a project to MS.
Regards
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
I am busy designing an upgrade 'wizard' for our web application, as was wondering if a .NET Woikflow project would be suitable for this? The application needs to perform three main tasks, viz. obtain configuration information, upgrade the database by running one or more scripts, and upgrade the web application by replacing files. More tasks may and probably will be added to the application later on. I'm looking for a task based, sequential flow type design, with a minimal, shared interface for all tasks.
A full-on Workflow application may be overkill, but if it provides a feasible to use, ready made and tested task structure, why should I not use it?
|
|
|
|
|
|
Thanks Pete. That deserves a good looking at. I've often coded along those lines without being aware that the tactic was 'formalised' as a design pattern.
|
|
|
|
|
Hi,
We have a WPF Windows Application and this application would be used by all our client having VISTA OS. For any error occured, system will create an entry in Application event log using the custom event source - "Application Manager". When the User Access Control (UAC) is turned ON, VISTA does not allow to register custom event source in the registry. But this works well when the UAC is turned OFF.
Is there any way where in we can create a custom event source (on the fly/programatically) with UAC turned ON?
Note: Our application gets installed using "Click Once".
Regards,
Vipul Mehta
|
|
|
|