|
Hi all,
Can anyone help me figure out weather vs2005 c# allow to have two different references for debug mode and release mode in the same project.
Thanks in advance
Regards
Praveen
|
|
|
|
|
If include the referred assembly's project into your solution and then put a reference to that project instead of directly referring the assembly, you will get configuration dependent references. I admit that this is kind of awkward, but it's the only way that I know of.
/Thomas
|
|
|
|
|
According to Microsoft, there is currently in VS2005 one xml proj file that holds the project properties, including a separate item group node for file and project references. The same file is used for both debug and release mode settings. This is definitely a limitation (for the time being). But improvements are under way[^].
SkyWalker
|
|
|
|
|
Does anyone know why Peek() is blocking when called on the StandardOutput stream?
I've heard that it might block if nothing ever has been written to the stream before Peek() is called. The problem occurs both with VS2003 and VS2005 (.NET 1.1 & .NET 2.0).
System.Diagnostics.Process p = new Process();
p.StartInfo.FileName = @"c:\windows\system32\notepad.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.Start();
int res = p.StandardOutput.Peek(); // this blocks
if (res>=0)
{
string s = p.StandardOutput.ReadToEnd();
}
Please help!
|
|
|
|
|
how to add two integers using c# language
|
|
|
|
|
int a = 2;
int b = 3;
int c = a + b; or simply
int c = 2 + 3;
"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
|
|
|
|
|
What do you mean? Can you be more clear at what you exactly want?
V.
I found a living worth working for, but haven't found work worth living for.
|
|
|
|
|
If you're asking questions on this sort of level, the answer is to abandon asking questions, buy a book and work through it.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I wanted to mock him, but I thought that people might think I was picking on the weak and defenseless, but what the hey - I feel some mocking bubbling up.
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 was offering serious advice. If he doesn't know how to add two integers, who knows what he'll ask next ? It's quicker for him to work through a book, at that level.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Wrong forum - this should be on the Mathematics and algorithms forum.
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 don't think you'll get thanked for that over on the M&A forum.
|
|
|
|
|
Colin Angus Mackay wrote: I don't think you'll get thanked for that over on the M&A forum.
At least somebody would be using it then. It's a great forum with not a lot being put on it.
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.
|
|
|
|
|
It seems that you don't need this message board, you need a book, or listen in class.
|
|
|
|
|
public long Sum(int a, int b)<br />
{ <br />
long f = 0;<br />
for (int i = 0; i < a; i++)<br />
{if (f % 2 == 0)<br />
{f ^= 1;}<br />
else<br />
{int k = 0;<br />
long e = f;<br />
while (e % 2 == 1)<br />
{e = e >> 1;<br />
k++;}<br />
int l = 1;<br />
for (int j = 0; j < k; j++)<br />
{l = l << 1;<br />
l ^= 1;}<br />
f ^= l;}}<br />
for (int i = 0; i < b; i++)<br />
{if (f % 2 == 0)<br />
{f ^= 1;}<br />
else<br />
{int h = 0;<br />
long g = f;<br />
while (g % 2 == 1)<br />
{g = g >> 1;<br />
h++;}<br />
int l = 1;<br />
for (int j = 0; j < h; j++)<br />
{l = l << 1;<br />
l ^= 1;}<br />
f ^= l;}}<br />
return f;<br />
}
Usage example: Sum(3,4). Will return 7.
|
|
|
|
|
Any NUnit tests available ?
Luc Pattyn
|
|
|
|
|
Sorry no. Wrote this in about 10-15 minutes. Tested it with two numbers and it worked. Good enough for me. I didn't want to spend more time coding this, as I think I already took this joke a bit far (though it would've been nice to write some code without using the increment operators )
BTW, refactoring in VS2005 is still one of my favorite features. Sure did the trick on those pesky, descriptive variable names 
|
|
|
|
|
*Family Feud voice* Good answer...Good answer lol
|
|
|
|
|
That cheered my day up no end .. thanks.
PS. You should write a book on the subject - any subject will do
Glen Harvy
|
|
|
|
|
how to convert an exisisting project
(windows application) exe file into an dll
thanking u
|
|
|
|
|
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
|
|
|
|