|
Hi.
Can you maybe elaborate a little more? Isn´t there some simple way of doing this? I was thinking of DateTime, perhaps creating a thread that checks to see if year is 2007 and then disables something in the program. Do you know how to do this?
Thanks,
F
|
|
|
|
|
Hi.
I was thinking about creating a thread that checks to see if year is 2007 and then disables something in the app. Is this possible? Perhaps someone can show me how this is done as it seems to be an easy way of doing this.
Thanks,
F
|
|
|
|
|
Why don't you check when the executed file was created? Although you can change the created date/time of a file.
Even when the user changes the date/time the created date will always remain the same, then you have the problem of getting the correct date/time for that user because if they set the clock back, DateTime.Now() should return the changed date/time.
If internet access is require then I am sure you can connect to Microsofts time server to get the time, or you could use your own server.
You could try and get the bios time? Not sure how tho, and if the date/time is set back further then the date/time created for that file then stop it from working.
Then you'd have to set some sort of flag, file/registry etc just incase the user uninstalls and reinstalls as the date it was created will now be the day they un/installed the software.
Hope that helps?
Gav
|
|
|
|
|
What you are trying to do is not easy at all (if you want something reliable at least.)
You could start by reading this article[^].
Luis Alonso Ramos
Intelectix
Chihuahua, Mexico Not much here: My CP Blog!
|
|
|
|
|
hi everybody pleas help me how to declare update varible with name @Marks1???
down you can see what i get when i try to exsecute command update?
Server Error in '/PrinterNew' Application.
--------------------------------------------------------------------------------
Must declare the variable '@Marks1'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Must declare the variable '@Marks1'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Must declare the variable '@Marks1'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +95
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +82
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +346
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +3244
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +186
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1121
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +334
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +407
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +149
System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +493
System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +915
System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +179
System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation) +1140
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +835
System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +162
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +118
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +107
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +175
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +244
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3836
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
|
|
|
|
|
Hi.
Judging from what I see your problem might be:
a) The name of the variable is not OK.
b) Variables are declared so: type var-name.
Hope this helps.
|
|
|
|
|
I know how to declare varible but i don't know how to declare varible for datagrid this varible shout be for one datadroplist who is in this datagrid.
this is what i have in my asp code??
<asp:cookieparameter cookiename="Marks1" name="@Marks1">
|
|
|
|
|
This error is telling you that Sql Server does not know about the SQL variable '@Marks1'. Are you attempting to call a stored procedure in this code? It sounds like the error is probably in that rather than in your C#...
Regards,
Rob Philpott.
|
|
|
|
|
Hello,
I have the following:
<br />
private void button_Click(object sender, EventArgs e)<br />
{<br />
this.demoThread = new Thread (new ThreadStart (this.ThreadProcSafe));<br />
this.demoThread.Start();<br />
<br />
}<br />
<br />
private void ThreadProcSafe ()<br />
{<br />
MyReference.Form2 form2 = new Form2();<br />
Application.Run(form2);<br />
}<br />
<br />
<br />
<br />
I was just wondering if that's the proper way to do it? It must be a separate thread, but I just don't know if doing it the way I am doing it is good programming practice. Is there information regarding launching applications on a separate threads. Sort of showing top-level windows in it's own process thread.
Thank you.
|
|
|
|
|
You want a new process, not a new thread.
System.Diagnostics.Process.Start(@"C:\MyApp.exe");
|
|
|
|
|
I load the other reference in the form of .dll. So how would I call that as another process? Other thing, my main window, that is launches the other processes, will show all the windows open in the window menu, and the only way to interact with the other windows is by using the worker threads.
Thank you.
|
|
|
|
|
Read up on .Net app domains. What are you trying to do? Do you have to have a separate application or process running? Ok, only having one running app makes life easier so that you can use object references and all that. The app is already running, just show some forms without using threads. The UI is the UI. It should be thin. You don't have to model the UI after the physical implementation details (threads). Use the minimal amount of threads to do some work so that the UI isn't hung up waiting for a calcuation to finish (the UI remains snappy). When the thread is done, update the form UI to present it to the user. A form should not have much code in it, it is just the presentation to the user. Lookup BeginInvoke() on CP and google.
If you really want to have some fun, you could use .Net Remoting to talk between apps. This way you can have independent apps up and they can talk to each other. Usually this is done when you have the exes running on separate machines.
Jim
|
|
|
|
|
Thank you for your reply.
I decided to use BeginInvoke, insted of creating a new Thread. What I am trying to do, is to have a main window application, which basically will have a list of applications to run. These apps are coded in C# as well, so I have to add them as references to the main window application. If the user launches one of these apps, I needed to be independent, because if that app displays a dialog box, it should only lock the access to the parent of that dialog box (built in), but not the access to the main window application, or other apps that might of being launch from the main window application. I hope that creates a picture for you.
Thank you again
|
|
|
|
|
If you are going to launch exe's, then Process.Start (as previously mentioned) is what you want to call.
Personally, I would not be launching exe's, but rather referencing the assemblies and creating an object which does what the Main entry point does for each "app." This way you can setup communication (if you want to down the road) since everything is running under the same app domain. If there is a modal dialog, then well, shouldn't the user be held hostage in order to reconcile the OK/Cancel dialog
Jim
|
|
|
|
|
how create a toolbar that is active when the main window is active then deactive when the main is so too?
p.s. i want it will be conform to windows xp and vista.
tnx
|
|
|
|
|
Hrm... I've never done anything like this, but you might look up MDI... or Controled Single Document Interface.
Otherwise, you can have one Form be your parent Form... Once that form loads, have another Form pop up, with it's parent the main form. Both methods should be compatable with XP and Vista... You can set all properties on the parent... Or you can have the parent subscribe to a custom event fired by the child...
|
|
|
|
|
Hello,
I want to build what would appear as a TAPI driver to an application, but actually uses a proprietory protocol for call functionality, using a VoIP softswitch. The "driver" can be detected and used by apps like Outlook, ACT, Goldmine etc (as far as the app is concerned it's a TAPI driver) but under the hood, it's all different.
I don't know much about TAPI (but don't know if I need to.) How could I encapsulate my code so that other applications think it's a TAPI driver? When an application (like those above) searches for a TAPI driver on the system, how does it identify them?
Any suggestions would be appreciated.
Thanks
|
|
|
|
|
You need to build a TSPI.
Have a read of This[^] as a starting point,
If you want to make life easy, JulMar[^] have a nice library for taking the hard work out of writing a TSPI.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
|
How can I change the refresh rate to my monitor using a C# code? Do u have a sample of somthing like this? Thanks.
Da_Masca
|
|
|
|
|
Hi,
I'm trying to access functions residing in a VB6 exe. Does anyone know of a way to access these functions in C#.NET?
Thanks,
Shehzad
|
|
|
|
|
Hello,
Would anyone please give me any idea about making a trial version (time limited) of my C# Windows Software. Or if you know any cheap software tool who can do that. Is there any nice tool available who will do the following things
1] Obfuscators
2] Setup maker (installer) (With checking .Net framework and sql server installed or not, ..)
3] time limited trial version.
I would highly appreciate your responses..
Thanks and regards
|
|
|
|
|
Hi,
I have a background worker in my C# Winform who is responsible for inserting a record in a SQL table. At the same time I (as an user) can insert or delete a record in the same table while the background woerker is busy in the background. Now, when I perform some insert/delete in that table sometimes, I get Exception named "Exception has been thrown by the target of an Invocation". I think may be it was the time when two threads conflict by trying manipulating sql table at the same time. Can anyone give me any clue how to identify the problem and how to solve that problem please....
|
|
|
|
|
Hi,
I can only guess but I had this problem once when using Reflection. When you call some method/constructor with reflection and an exception is thrown within this call than this kind of exception will come up.
|
|
|
|
|
Perhaps you can catch the exception in code and take a look at the stack trace property on the exception object. Maybe that can help get you to a line of code that might lead you to the offending object.
Jim
|
|
|
|