|
Boris The Bold wrote: I think that the person who bought the computer should control how and what they can do on it and not Microsoft.
Microsoft were slammed repeatedly for allowing this. They finally learnt their lessons and made the OS a whole lot more secure.
|
|
|
|
|
I would like to know who to accomplish the following goal using an existing C# 2008 desktop application.
I would like to take the C# run time input and output parameters and possibly put the calls into a batch file and or with some method you recommend. Here are the following I would like to complete:
1. I would like to run the C# 2008 desktop application and give it input parameters. (This is how the program currently runs.)
2. I would then like to wait for a response from the C# 2008 desktop application before proceeding to the next step. (The program needs to
wait since it is calling a web service and loading documents to the web service.) I need to make certain the response code call to the web service = 0.
3. Next step depending upon the response from the web service.
a. If the response from the web service = 0, then the C# 2008 desktop application is called again with parameters to close out the customer account on the web service.
Also under this step, the results for the second call to the desktop application should be displayed in a message the user can see.
b. If the response from the web service not = 0, then a message should be displayed to the user stating what the problem is. No further call is made.
Thus can you show me code and/or point me to a reference on how to accomplish this goal?
|
|
|
|
|
I would save configuration to an xml file, and then read from that. If it is real simple you can use an ini file, but that is probably considered obsolete.
|
|
|
|
|
Can you show me code on how to read the xml file? Would I write some C#.net code? Would I use a dos bat file to read the xml file? If so, how would you have the dos promnpt command read the xml file?
|
|
|
|
|
|
All of the different steps can be accomplished without restarting the program. Start with the input parameters as required and then use the results of the webservice to decide whether the program terminates or requests further input and restarts. The actual design will depend on how the input parameters are to be passed to the program.
Use the best guess
|
|
|
|
|
If you want to access functionality of your C# program from some kind of script, you may want to have a look at the Application Framework (namespace Microsoft.Samples.ApplicationFramework): that allows for sending requests to a running application.
|
|
|
|
|
dcof wrote: using an existing C# 2008 desktop application.
All of this depends on what the application does. Specifically HOW does the application take "input"? HOW does the application provide "output"?
|
|
|
|
|
I want code for video streaming in c#
can you help me
|
|
|
|
|
Talal H.Daoud wrote: can you help me
No, not without a more specific question. We can't give you the code for your whole project. You need to tell us what you've tried already and ask why that didn't work.
|
|
|
|
|
You need to be more specific. Do you want to create a windows app or a web app?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Are you creating the stream server or the client side?
|
|
|
|
|
|
I would like to write a program of Fibonacci sequence.
F0=0;
F1=1;
F2=F0+F1;
F3=F1+F2;
.
.
Fn=Fn-1 + Fn-2
Like this.
And for sure, I know that I have to use recursive algorithm to do this.
But this is first time to make this kind of program.
So could someone help me out?
|
|
|
|
|
|
It's a homework assignment - that's why we're getting them now.
|
|
|
|
|
harold aptroot wrote: Why?
It's obvious: infinite recursion is more fun than anything with a wimpy limit on the number of iterations!
Factorials are supposed to end, which spoils the fun of blowing the top off the stack.
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
Blow the top off the stacked what?
|
|
|
|
|
OriginalGriff wrote: Factorials are supposed to end
Suffering from BDS again? (Bacon Deprivation Syndrom)
What am I missing here?
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
Factorials are the "normal" example given to students to teach them recursion:
!n == n * !(n - 1) where n > 1 So factorials are naturally limiting - whatever finite number you start with, there is a termination to the sequence. (And never mind that recursion is a poor way to implement it anyway)
Fibonacci numbers on the other hand are different:
Fn = F(n-1) + F(n-2) Where F0 = 0, and F1 = 1 So instead of decreasing towards a limit, Fibonacci numbers increase to towards infinity, with no limiting condition at all to terminate them. That makes them a poor candidate for recursion, because unless an artificial outside limit such as "n < 1000" is applied as well, the recursion continues indefinitely, and the stack is compromised.
Another very poor implementation!
Thinking on this before I posted, I realised that I was wrong: the only practical way to write Fibonacci sequences as recursive functions means providing the limit first, and then calculating all the values before it, in much the same way as a factorial would be - I was thinking of it in terms of calculating the sequence from the start, without providing a limit: the sensible way since it doesn't duplicate work!
As a result, I was wrong, the stack won't self destruct.
It's still a silly recursion example though!
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
OriginalGriff wrote: Thinking on this before I posted, I realised that I was wrong
Are you properly baconized? I hope there isn't another shortage on the horizon.
We all know that'll wreak havoc on your otherwise exceptional abilities.
(Which would indeed be expected from every bacon afficinado under such dire circumstances.)
OriginalGriff wrote: It's still a silly recursion example though!
Agreed!
Cheers!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
Sottyoru wrote: So could someone help me out?
Jack Daniels, Captain Morgan, Jose Cuervo... Choose your poison.
|
|
|
|
|
The only reason to use recursion is if it's a homework assignment; and if it's a homework assignment, you must do it yourself.
You learn more by getting it wrong and struggling and trying many ideas.
|
|
|
|
|
Picking up a good book on C might be good for a start.
|
|
|
|
|
A recursive function is simply one that calls itself. In the wrong hands, a recursive function can blow your application up. Try the following function to see what I mean:
public void MultiplyRecursively(int value, int multiplier)
{
int output = value * multiplier;
Console.WriteLine("Multiplied by ={0}", output);
MultiplyRecursively(output, multiplier);
} As this function has no terminating condition, all sorts of nasties can occur. I suggest that you run the code to see what happens.
|
|
|
|