|
Is it possible to play a video file on a specific area on the form using code code without placing a control to contain the video file?
any C# example plz?
Thanks..
|
|
|
|
|
You would need a control that has the ability to play the video...
|
|
|
|
|
I want to know your advise plz..
I have a software and I don't want use to be able to use it once downloading it so I though of having an activation process first..
what do you think?
and what's the best way to do it using C#?
and how to make sure another person who will download the same software won't be able to use using an activation code givento another customer?
|
|
|
|
|
There is no fool-proof way to ensure security in the manner you are talking about.
The best way, based off what you say is communication to a database to ensure that an activation code hasn't been used more then once, but then you limit your software in the regards that a host computer must have an internet connection to activate the software.
Then you would also have to check consistently if the activation code is correct for each use of the application.
What if a client does not have an activation code?
And you're ignoring that all .Net applications compile to MSIL, which isn't that hard to go through using Reflector. If you build in an algorithm to generate an activation code, if determined enough a user might be able to generate his own activation codes.
|
|
|
|
|
This question has been asked and answered so many times in this forum that it is impossible to believe that you have even tried to search for an answer.
Do not be so lazy! Do your own research.
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.”
|
|
|
|
|
How can I customize the Crystal Reports Viewer statusbar to have some other controls on it, e.g. comboxbox, calendar, etc..
|
|
|
|
|
By doing some research for yourself.
Try Googling crystal reports viewer statusbar
This site is really not the place to try to get a cheap tutorial in how to program. Do your research, try for yourself and then, and only then, ask here with specific problems, showing what you have tried and what and where the error is.
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.”
|
|
|
|
|
Is it possile to use the data MDF file on the client when distributing my software installing the SQL Server on the client machine? just like a stand-alone database file?
|
|
|
|
|
No, you can't. What's going to read/write the data in the file then? At a minimum, you'd have to use SQL Server Express Edition.
|
|
|
|
|
I have a (Daily Report) shown on Crystal Report Viewer and I want when the user right click anywhere on the viewer to display a popup calendar so user will select another day to view its report?
|
|
|
|
|
I want to know where can I get a step by step tutorial or samles on how to create and connect crystal reports with SQL Server 2005 at run time and pass the codethrough stored procedures?
|
|
|
|
|
Hallo, I am working with Threads and I Know the main Rule telling that no one Control created with one Thread can be accessed by other Thread, I also know that this is not an absolute rule and it can be solved, but my question is:
- This Error for crossed threads affects only to Controls or also affects to variables, methods, Lists and objects, or I Can share those objects between threads without any problem, and only with Controls I am going to have a problem.
Please answer me in the way Error sharing Variables Yes/No ...
Regards
|
|
|
|
|
FJJCENTU wrote: I also know that this is not an absolute rule
I don't agree. It is absolute, Controls are not thread-safe.
FJJCENTU wrote: it can be solved
Yes, using Control.InvokeRequired and Control.Invoke; and not in any other way.
FJJCENTU wrote: affects only Controls?
No all data that is going to be read/written by several threads at once must be protected; use thread synchronization stuff such as locks, mutexes, etc.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
OK I understand, please only two questions more:
1) I am using ThreadPool for doing a repetitive job
in the way WaitCallBack WCK = new WaitCallBack(Method1);
ThreadPool.QueueWorkItem(WCK, List1);
Question: is needed that Method1 be Synchronized ?
2) If The Method1 call a Synchronized Method, and this second method call a third Method is needed that the third method be also synchronized ?
regards
|
|
|
|
|
FJJCENTU wrote: is needed that Method1 be Synchronized ?
Methods don't need to be synchronized, accesses to shared data should.
As I said: all data that is going to be read/written by several threads at once must be protected
Here is a simple example of how things CAN and eventually WILL go wrong:
List<int> power1=new List<int>();
List<int> power2=new List<int>();
public void Add(int x) {
power1.Add(x);
power2.Add(x*x);
}
Then two threads are created that generate random numbers x and call Add, hoping to obtain a list of numbers, and in parallel a list of their squares. Everything will run fine; suddenly the operating system will decide to temporarily halt thread 1 (which was at point A), and resume thread 2.
So the lists will contain
power1 a b c x1 x2 ...
power2 a*a b*b c*c x2*x2 ...
and it is only when thread1 becomes active again that x1*x1 gets added to list power2.
The solution could be like this:
object powerLock=new object();
public void Add(int x) {
lock(powerLock) {
power1.Add(x);
power2.Add(x*x);
}
}
so whenever some thread is inside the critical region protected by powerLock, no other thread needing the data protected by powerLock can but in.
FJJCENTU wrote: a third Method is needed...
as I said, it is not methods that get protected, it is data. And the example should make that clear.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
I know how to build a dynamic array and initilize the array. This is not my problem. That part of my code is working just fine and there is to much code to change the logic. So using the consepts of dynamic arrays... I run into a issue. I know it is simple but I can not find information about it.
The issue is this... If my sql statement returns to results the array is not built. Which cause the applciation to error. Is there a way with out throwing a lot of try catch's in my code to do something like
x = DynamicArray.Length
And if the array was not initialized for it to return a numeric value of -1 instead of it erroring saying the array is not initialized?
|
|
|
|
|
Do you mean something like
x = DynamicArray == null ? -1 : DynamicArray.Length;
?
|
|
|
|
|
Quite possibly but I don't understand what the statement is doing exactly. THe '?' and everything after how does that work in c# language?
I am guessing essentially what the statement is saying is:
x = -1 if the dynamic array is null by placeing the -1 value in to the Dynamic array as a result when it is called.
If this is the case I see many examples I could use this functionality. Is there something I can read or you could explain so I can adapt that to future logic?
|
|
|
|
|
x = DynamicArray == null ? -1 : DynamicArray.Length;
is just an alternate (shorter) syntax for:
if (DynamicArray == null) x = -1; else x = DynamicArray.Length;
|
|
|
|
|
Oh it's just the ternary operator
result = condition ? true-value : false-value
It just selects one of the values based on whether the condition is true or not.
So basically it's
if (condition)
result = true-value;
else
result = false-value;
But as an expression, instead of a statement
|
|
|
|
|
Nope x = DynamicArray == null ? -1 : DynamicArray.Length; is shorthand for
int x = -1;
if(DynamicArray != null)
x = DynamicArray.Length;
|
|
|
|
|
Thanks I think I have a better Idea and something new to play with.
|
|
|
|
|
Hm you raise an interesting point - is the second argument always evaluated?
|
|
|
|
|
No, but the ternary operator syntax is unclear if you haven't seen it before.
|
|
|
|
|
So... let me get this straight.. does it act like the expression form of
result = arg1;
if (!condition)
result = arg2;
Or like:
result;
if (condition)
result = arg1;
else
result = arg2;
|
|
|
|