|
Sounds like a session key to me, or something that should be stored in the session along with a key. If your web service infrastructure already has the concept of a session (I can't remember if WCF does or not), put it in there, for sure.
|
|
|
|
|
I put it in the database. One benefit is that if the user logs in from another station later, the new token overrides the old one so the previous login becomes invalid -- avoiding having the user logged in twice.
|
|
|
|
|
Thanks all.
Finally I'm trying to implement the session method but have a problem. I create a little form in ASP.NET to test de WS, 2 textbox to insert the user and password and 2 buttons, one to verify the user and password and a second one to call a WS function that check the if the token sended by the user is the same than the saved in Session but in this function the session value is null.
When I call the second function this call again all web service and this empty all the data?
If you need for understant better my queston I can post the WS code.
|
|
|
|
|
Just wondering if anyone else has experienced this before. I have a check box with style Appearance:Button (actually it is wrapped in a user control but that isn't relevant here). Two instances of this check box on different panels within the same application are displaying differently: one has the normal 1px control border like real buttons, and on another panel the same control is displaying with a double thickness border. It also seems to be offset by 1px when I try to read its location, or alternatively its painting region is offset by 1px (I'm aligning another control on it and it is not quite lining up).
|
|
|
|
|
How do I put my window at the top of your desktop (by analogy - the task bar)?
|
|
|
|
|
What do you mean exactly? TopMost or on a certain Location?
Are we talking WinForms or WPF?
V.
|
|
|
|
|
You are not going to put any of your windows on my desktop, you hear!
It is strictly forbidden!
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
|
|
Fetch[^] handle of the desktop-window, set it as your parent[^], make your form the "bottom most[^]" and you're there. Should look like an IFrame in your desktop, should work and behave in the same way.
Good luck
Bastard Programmer from Hell
|
|
|
|
|
wave file can be add to project as resources but mp3 i cant played it as resources ....what the problem with mp3 can anyone help me with that please
|
|
|
|
|
1. One exclamation sign suffices if not separated from last word.
2. What have you tried to play the mp3 in question? What error messages (if any) did you see?
After getting the Play part to work, you can deal with attaching the file to your project's resources pretty easily.
Ciao,
luker
|
|
|
|
|
i try to add mp3 file to resources without open dialog its not work ..
after i add wav file to resources i played it with :
SoundPlayer sndplayr = new SoundPlayer(resource.Properties.Resources.xp);
sndplayr.Play();
and i try :
System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly();
System.IO.Stream s = a.GetManifestResourceStream("xp.wav");
SoundPlayer player = new SoundPlayer(s);
player.Play();
wave file played but mp3 i can't .. is that any method to do it ..
|
|
|
|
|
You can embed anything (well, any file or finite stream which can be saved as a file) as a resource. I don't think there is native MP3 playing in the Framework, though.
|
|
|
|
|
AFAIK (and MSDN[^] is pretty categorical about it) SoundPlayer can't handle MP3's - you would need to use a MediaPlayer embed to play them. The problem with that is that MediaPlayer only works with files: it has no facility to work with streams. So, you would need to export the MP3 from your resources into a temporary file, play it, then clean up after yourself when you are finished. Which defeats the purpose of having the file as a resource in the first place!
There is an alternative solution here: http://stackoverflow.com/questions/184683/play-audio-from-a-stream-using-c-sharp[^] but I haven't tried it and can't vouch for it's effectiveness!
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
i look about it but i don't understand anything i m newer in C# can you help me please with that in a little sample cod project ?
|
|
|
|
|
If you don't understand the link I gave you, then probably the best thing to do is put this project on the shelf for a while - just until you understand a bit more about the basics - otherwise you will probably end up missing something important and never learn it!
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
This is a repost of the question I responded to here[^].
|
|
|
|
|
I can't believe, this is the same guy.
|
|
|
|
|
I know, hence my comment.
|
|
|
|
|
Repost! do not repost your questions here.
***** Programme comme si dept soutien technique. est plein de tueurs en série et ils savent adresse de votre domicile. *****
|
|
|
|
|
When my background thread calls the following code,
public void Func(object Request, object Response)
{
if (this.InvokeRequired)
{
this.Invoke(new ResponseHandlerDelegate(ResponseHandler), new object[] { Request, Response });
return;
}
}
does the background thread get blocked at the Invoke call until the UI thread completes the function call?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Yes, the calling thread will block.
If this behaviour is not desired, you can circumvent it by using BeginInvoke instead of Invoke .
Ciao,
luker
|
|
|
|
|
And if I use BeginInvoke , can I "stack" multiple calls to BeginInvoke before any of them completes?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
You can, but be aware that this can lead to unpredictable results as they might not complete in the order you expect.
|
|
|
|