|
Thanks. It should not be just doing an application check, but handling control of the critical parts of the app from remote as well. See dan's post, as well as my reply to him ( I would share how I protect my code, but it's a heavily guarded secret )....
BTW, my app isn't just on a leash, but has a choke collar on the leash. It really isn't getting away
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Sincerely Samer Abu Rabie
Note: Please remember to rate this post to help others whom reading it.
|
|
|
|
|
Imagine this situation:
Multi-user system over network. When error occurs on either machine, it is logged on a single shared file across the whole system. If one machine trues to write while another one already is, then of course IOException is thrown. (file is being used by another process...)
Question: Is there any logging library that is reliable for this kind of situations? It must be able to wait and try to log the event as long as the target file is in use or for a specified time. Am I asking for too much?
Insert funny quote here.
|
|
|
|
|
Hi blackjack,
well there is a library called log4net http://logging.apache.org/log4net/index.html[^].
If you read through the documentation you will find somthing called RemotingAppender or UDPAppender. What you can do with this is to send all your logging events to a special sink. This sink will get all events and could write them into a single file.
I think this is a much better way than using a shared file...
Hope this helps you a bit.
Regards
Sebastian
|
|
|
|
|
SeMartens wrote: well there is a library called log4net http://logging.apache.org/log4net/index.html[^].
I haven't use this too ... but if i wanted to make it by hand I would think of some kind of queue where when a user has an error sends it to the queue which will watch that logging file ... and when the file is available it logs the error ... if it couldn't ... it waits then tries again.
Sincerely Samer Abu Rabie
Note: Please remember to rate this post to help others whom reading it.
|
|
|
|
|
Depending on your situation (company network, access to a mail server, etc.), you might consider using email. It gives you the benefit of being able to add attachments, etc.
I haven't used Log4Net, but it does support emails: log4net.Appender.SmtpAppender.
Something that looks pretty similiar to Log4Net that I've used is, the logging application block from Microsoft: http://msdn.microsoft.com/en-us/library/cc309506.aspx[^]
|
|
|
|
|
I am getting an error loading a function from an unmanaged DLL, but I'm getting this error:
System.DllNotFoundException: Unable to load DLL 'MyLibrary.dll': The specified module could not be found.
(Exception from HRESULT: 0x8007007E) I have the DLL file in the project next to the source code files, and its properties are set to "copy if newer". Even "copy always" did not work. The file is there, but the application can't find it (at least in VS Debugger)!
I tried checking File.Exists("MyLibrary.dll") , and it returns true!
Any idea what's happening?
|
|
|
|
|
Post the code you are using to load the dll.
Simon
|
|
|
|
|
[DllImport("MyLibrary.dll")]void myFunction(); I think I found the error: MyLibrary.dll depends on another DLL, and that other was not found. The error message is misleading.
Thanks.
|
|
|
|
|
Cool. At least you figured it out.
Simon
|
|
|
|
|
In C#.net
I am tring to update progressbar , text box
from thread. Please advice
|
|
|
|
|
Check this[^]. Other way is to use BackgroundWorker class.
|
|
|
|
|
What's the problem? Are you getting an exception? Post it with the stack trace and all the details.
You must update GUI from the main GUI thread. You can use .InvokeRequired[^] to check if you are on the GUI thread or not, and you can call .Invoke() to request that the GUI thread execute your method.
There's an article about it here[^].
Simon
|
|
|
|
|
|
I believe the exception you are getting is a cross thread exception ... this occurs when your thread is trying to access controls in the form which are created by the main thread ... a common exception in UI especially when using threading and asynchronous calls ... read about threading ... and search for cross threading exception.
Sincerely Samer Abu Rabie
Note: Please remember to rate this post to help others whom reading it.
|
|
|
|
|
Hi
I'm trying to do a logical AND between two integers (x && y) but I get the following error:
Operator && cannot be applied to operands of type 'int'
I get a similar error when converting the integers to byte.
Is there another operator/function I could use or to what should I convert the integers to be able to do the logical AND?
|
|
|
|
|
You're talking about bitwise operators. See this table of C# operators[^]. It's about half way down, titled "logical AND"
The operator you want is just a single '&' sign. (See here[^]).
[Edit: Oops, for some reason I gave you SQL server bitwise operator links.]
Simon
|
|
|
|
|
You can't do a logical and between two integers. Logical operators only works with boolean types.
What you want is the binary operator &, not the logical operator &&.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
C++ programmers sometimes treat integers as Boolean values, where 0 is false and non-zero is true. This doesn't work in C#, which is more strongly typed.
If this is what you want to do, it can be written:
((x != 0) && (y != 0))
|
|
|
|
|
C# doesn't use (int)1 as true , so you will need to use (x==y && y==1)
see the link below, but to make a long story short, the C# compiler tends
to be more like a binary child, it likes things in strong typed format,
as such if there is any disention inside its ranks, it will just throw a compilation error.
just try something like
int a = Math.Round(Math.PI,0);
which throws Error:
Cannot implicitly convert type 'double' to 'int'.<br />
An explicit conversion exists (are you missing a cast?)
and can be resolved by
int a = (int)Math.Round(Math.PI,0);
but you cannot use:
int a = 2, b = 3;
if((bool)(a)&&(bool)(b)){}
alternativly you can restructure to just use bools
bool bx;
bx = false;
bx != bx;
or make an operator
BinaryAnd(int x,int y)
{
if(x==1&&y==1){return true;}
return false;
}
you should say more about how you intend to use it,
because there are lots of ways to get the same result.
clicky...hope it helps, my C is a bit rusty, it's been a couple of years.
|
|
|
|
|
Thank you all for your assistance!
Once you pointed me to the & operator I was on my way!
I think I should explain my use of the AND operator.
I have an enumerator of which each item/component has a binary value (1,2,4,8,16...etc)
I do this so that I can represent multiple of the enumerators values with a single integer.
E.g. the integer value 25 means that components 1, 8 & 16 are chosen.
When I want to add a enumerator value to the integer, I AND the int with the enumerators value, a result of 0 means that values hasn't been added yet and is safe to add.
//y is my enumerator
if ((TotalInt & (int)y) == 0) {
BinaryAddedValue = TotalInt + (int)y;
}
else {
BinaryAddedValue = TotalInt ;
}
So in my case, doing the AND between integers, I need to and the entire bytes and not just true or false for 1 and 0.
I actually havn't come around to testing it yet, hope it works...
Thanks again!
|
|
|
|
|
Hi,
I have a winforms application that I develop. The application is used for different projects and a variety of customers. Different projects require different features and I use the Settings of the application to control which features are available in each project. I am looking for a way to manage these features. Maybe have different settings files? I would like to be able to change these settings (as in user mode settings)
Any suggestions are welcome.
Thanks for your time
Natza Mitzi
|
|
|
|
|
I would create a build for each customer and use defined constants inside each build to customise the app as required.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I am using msi installers. My thought was to add a custom action during the installation or on the first time the app is running and preset the variables.
Even so I am not happy with the solution since it seems too loose and not easy to maintain.
Thanks. If anyone has more ideas....
Natza Mitzi
|
|
|
|
|
I think your best bet may be to write a utility that allows you to create an appropriate app.config file (the basis for user mode settings), and use this utility to create custom versions of the app.config.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|