|
Change the output type in the project settings from windows application to class library.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hello!
This is my first post here ...
I've written this configuration file to run in my .NET 2.0 application:
(The post isn't showing the XML, so I'll put an image)
http://img213.imageshack.us/img213/3071/configgr7.gif
... and also this SectionHandler class:
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.Configuration;<br />
using System.Xml;<br />
<br />
namespace Prototipo<br />
{<br />
public class PublisherInfo<br />
{<br />
private String regEx;<br />
private String destinationFilePath;<br />
<br />
public PublisherInfo(String r, String f)<br />
{<br />
regEx = r;<br />
destinationFilePath = f;<br />
}<br />
}<br />
<br />
class SectionHandler : IConfigurationSectionHandler<br />
{<br />
public object Create(object parent, object context, XmlNode section)<br />
{<br />
string r = section["regEx"].InnerText;<br />
string f = section["destinationFilePath"].InnerText;<br />
return new PublisherInfo(r, f);<br />
}<br />
}<br />
}<br />
But when I try to get the information from that file I get exception, saying that there was an error while trying to initialize the configuration system, and an innerexception saying that a section
is repeated (I suppose it's the "publisher" sections).
Isn't there any way to process this file without getting errors? If not, how would you re-write the configuration file so that I don't get any error?
Thanks a lot!! t any error?
Thanks a lot!!
|
|
|
|
|
Hi,
i need to make a call to a webservice and in addition abort this call if the response exeeds some specific time. I want to do this because i have to provide a method to the user which returns a value from a webservice through this method not through some callbackevent. This way i decided that it would be a good way to wrap the call to the service in a method, wait for the response (or a specific time, whatever comes first) and return the value to the user.
What i have done so far is that i make a call to XXXAsync, hooked up to the return event and set a flag that the webservice responded. In the method called by the user a wait for this flag to be set to true or a specific time, but somehow the webservice return event never fires. If i remove the waiting loop everything works fine.
Here is some sample code of the method i want to wrapt the webservice call in:
<br />
public float FaceImageQuality(Image faceImage)<br />
{<br />
this.retrievedFaceQuality = -10;<br />
this.faceQualityCheckReturned = false;<br />
fvws.FaceQualityAsync(ImageToByteArr(faceImage));<br />
int localCounter = 0;<br />
while (localCounter < this.maxWaitTime || this.faceQualityCheckReturned)<br />
{<br />
localCounter++;<br />
Thread.Sleep(100);<br />
}<br />
if (!this.faceQualityCheckReturned && localCounter >= this.maxWaitTime)<br />
throw new Exception(String.Format(this.webServiceDidNotResponded, (this.maxWaitTime * 10), "FaceImageQuality"));<br />
return this.retrievedFaceQuality;<br />
}<br />
<br />
private void fvws_FaceQualityCompleted(object sender, FaceValidationClass.FaceValidationWebService.FaceQualityCompletedEventArgs e)<br />
{<br />
this.retrievedFaceQuality = e.Result;<br />
this.faceQualityCheckReturned = true;<br />
}<br />
When i remove the Thread.Sleep call and the loop off the code the event fires, but only after the method is left.
Does anyone knows a way to solve this?
Best regards
Jens
|
|
|
|
|
Hi,
Can anybody help me out to get the HTML source of webpade in C#? Right now thru below code I am getting the inner code but that is not whole source which I get when I do 'view source' on webpage....
.
.
.
ibrowser = (IWebBrowser2)pDisp;
HTMLDocument idoc = (HTMLDocument)ibrowser.Document;
innerHTML = idoc.documentElement.innerHTML;
......
plz do reply asap.
thanks n regards,
Supriya
|
|
|
|
|
One way to get the page's entire content is to use this[^] class. The Content property holds the HTML source.
/ravi
|
|
|
|
|
hey that prob got solved actually, thx anyway!
Now I want to change the text on webpage, U can say I want to highlight particular word on webpage n display that page again.
Now I m doing below thing,
.
.
String str = internalBrowser.Document.Body.InnerText.Replace("MSN","mSn!");
internalBrowser.Document.Body.InnerText = str;
.....
but when page is displayed just the text gets displayed n not the exact page or Images n all...
I have one more option to parse internalBrowser.Document.Body.InnerHTML n change the word n append tag for highlighting the particular word... is it right or is there any other way????
thx
Supriya Tonape
|
|
|
|
|
Hi
Just want to hear whether C# can be successfully used to develop games in general and particularly multiplayer games? Or else what would be the preferred language for these higher end games?
Thanks.
Kobus
|
|
|
|
|
While games (even pretty complex ones) can be created with C#, the games you are used to playing were probably written using C++ (and possibly a few other languages)
|
|
|
|
|
It can (normally using Managed DirectX), but games are more traditionally written using C/C++.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
kbalias wrote: Just want to hear whether C# can be successfully used to develop games in general and particularly multiplayer games? Or else what would be the preferred language for these higher end games?
Yes, it can. If you download Visual C# 2005 Express Edition[^] and then the XNA Game Studio Express 1.0[^] (both free) you can develop games in C# for Windows and the XBOX360. (NOTE: XNA sits on top of C# Express which is why you need to download and install both items. If you already have Visual Studio it will happily sit side by side - I have that set up at home)
|
|
|
|
|
C++ is king, but C# can do a lot of types of games, I just wouldn't choose it for an intense 3D experience.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: I just wouldn't choose it for an intense 3D experience
Oh I don't know. It would be interesting to have Sloths as the monsters in the new version of Quake.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I'm trying to find c# barcode generator control (code128). Does anyone know where can I find one? I found some on codeproject, but they're all either generators for other barcode styles, or they're written in other languages.
thanks in advance
cellardoor
|
|
|
|
|
What are the other languages ? If VB.NET, that's easy to convert, or use in a DLL.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I found one written in c++ and I really don't know how to use it...
cellardoor
|
|
|
|
|
OK, you could try to make it a managed DLL, or you can try to rewrite it in C#.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
How do I make it a managed DLL? Is there a step by step guide to this problem, or at least an example?
cellardoor
|
|
|
|
|
A managed DLL is a Class Library project written in a .NET language
|
|
|
|
|
search on code project, and you will find many; all kinds of bar code in all kinds of languages.
Did you see this one [^]?
Luc Pattyn
|
|
|
|
|
Hi all,
In VS2005, is it possible to set a USercontrol's property in the "Properties Window" when designing the container form? How can I make that a Usercontrol property appears in the "Properties Window"?
Thanks in advance,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Hi Marc,
While developping your UserControl, add a property the way you always do it.
Then add XML comments (triple slashed) if you want these
Then add attributes for the future users of your UserControl
When using your UserControl, the Designer will:
- show the description you gave as a help text (at bottom of pane)
- use "Category" to group properties (when in grouped rather than alphabetical order)
in the Properties panel of your UserControl,
An unfortunate consequence seems to be, if you want both XML and Designer help,
you end up repeating the same textual description.
like so:
[Category("MyUserControl"), Description("Gets or sets a flag to "+
"indicate ...")]
public bool SomeFlag {get {return someFlag;} set {someFlag=value;}}
Luc Pattyn
|
|
|
|
|
Helo
im trying to get MCTS exams , can anybody give me an idea about it
or any materials ,
thanks
|
|
|
|
|
And this is why the exams are useless. People pass because they get the info they need online, not because they know anything.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
Hello...
Does anyone have a problem in WebBrowser.Print() Method ?
My code is :
this.webBrowser.Navigate("http://www.microsoft.com");
this.webBrowser.Print();
It prints always 2 pages, the first page is always empty. The second page is the microsoft website.
Is that a bug from microsoft ?
Thanks...
|
|
|
|