I'm working on creating a 30 day free trial of my Air app.
When the 30 day trial begins the current date is stored in the local encrypted database. Then the date is checked against the current date if the difference is 30 days or more the application denies access and the users is prompted to purchase a license.
It seemed I had have everything working fine but I just ran into a problem.
I changed the date on my machine which made my Air app think this was the current date, allowing the 30 day trail to still be active.
I'm wondering what the workaround might be to fix this? Is it possible for Air to get the current date not based on the computers set date?
If you application has logging to a file system, preferably a sign-on logging event, write a file or update a file.
Prior to this writing step, do a check in that directory to see if any of those files are dated in the future. If they are, the user has rolled back their system. Flag it.
Try not to use sharedObject cause that I might get blowaway. Alternatively you can update a table in SQLite or whatever persistence mechanism you are implementing in your app.
Related
I have accidentally deleted my project at Google API Console and when I try to recreate it, It doesn't give me it's previous ID and attaches unwanted numbers at the end of it.
Is there any way to get that ID back?
If you have deleted a project on Google Developer console. You will get an email from Google something like this.
Dear Google Developers Console User,
You deleted the project “BigQuery” on Jul 16, 2015 6:33:44 AM PDT. If
you still want to delete this project, you don’t need to do anything.
The Google Developers Console team will remove your project
permanently one week from the time of your request.
If this project shouldn’t be deleted, you must visit the following URL
before Jul 28, 2015 12:50:21 PM PDT.
https://console.developers.google.com/project?pendingDeletion=true
After Jul 28, 2015 12:50:21 PM PDT, the project will be inaccessible
and can no longer be undeleted.
If you have any questions, please visit the Google Developers Console
Help at the following URL, or contact support.
https://developers.google.com/console/help/new/
Thanks, The Google Developers Console Team
If you ignore that email and allow the time to run out. Your project is gone and I have never known anyone to be able to get it back after that date. Check your email if you are lucky the date hasn't expired. If not your project is gone and you need to create a new one with a new project id and accept the consequences of deletion.
IMO: I really wish they would add a lock to projects so we can prevent ourselves from deleting something we really really should not.
Google project id is system generated and once the project is already deleted, you can't have the same id as before. I suggest you to check if the project is already "shutdown", because I believe that there's a 7 day grace period to recover it. Check out this google help documentation.
I need to create a demo Asp.net site that must keep a fixed date due to the application/data. ie. the server date will always be set to 1 Jan 2014, and will run software and serve the pages as if that was the date.
VM is set up, snapshot to the required date, ignore host time and auto time updates, so that it can be restored repeatedly.
Only problem is IIS/Asp won't serve webresources.axd files when the date is incorrect (I get a 404).
I've managed to get everything served locally on the server (not sure how, it didn't work at first), but can't seem to from a networked machine. All the aspx pages serve correctly, and the software itself is running fine. Just those generated axd files.
Not sure if it's relative to the install date / software build date / client date, I'd just like it to ignore it!!!
The failure to serve the resource is identified by a "'WebForm_InitCallback' is undefined" error on the browser.
In cases like this, I find it better to separate the two concepts: current system date/time and current run date/time.
I would allow the system date to be the real date.
I would find everyplace in the code that depends on DateTime.Now or the equivalent, and take that date from configuration or other input sources instead. That way, you can "fake" different dates just by changing configuration, or even user input.
I have read in a few places that each user needs to have their own front-end file when using an access split DB. Is this true? If I place a single copy of the front end on the network, and allow each user to open a local instance of that file, will it create conflicts? Do I really need to put 10 copies of the same file on the network and let each user open his/her own copy? I am having trouble believing that, though I have seen it mentioned a few times on the web (unless I misinterpreted). Thanks guys!
Running the FE over a network connection will add more bandwidth clutter, too. You really must deploy the FE to each workstation for the best user experience.
The way we handle it with our current project is to have a copy of the FE on the server that each user downloads. There's a 'local' version number baked in to the FE app, and a 'latest' version on the BE. If there's a mismatch detected due to a new version of the FE being deployed, a VB script will download the latest version and replace the one currently on the User's PC (using a batch file). It's set to do this version check when it first starts up and then periodically while the app is running (with an ability to opt-out if the User's in the middle of some work).
I have a windows service that runs every 1 hour. I would like to store the last run date-time so that I can check the value (last run date-time) every time the service runs.
This value is used as one of the parameter for stored procedure used by the service to get data.
Now, my question is what is the best/ideal way of storing this last run date value?
I can think of 3 ways:
Store it in a database table.
Store it in a text or XML file in the application folder (question here is: is it good to create a text
file in application folder and update it every hour?).
Create a section in config file and update it every time service is executed.
Experts, please advise.
If you have a single service that needs to check the last time the process it executes was run to completion, I would store in as a user setting item. If you are thinking that maybe you'll have many services that share this task, putting it a shared location (like a database) would be helpful--although, it should be easy to migrate the data from user setting to a database should you need to use multiple services.
I would avoid a custom XML or data file simply because there's already support for user (run-time) settings in .NET and Visual Studio.
Update:
If you want to use user settings, you can simply double-click the Settings in Solution Explorer (under Properties in a Project) or in the properties for a Project, select the Settings tab. Add a value with a User Scope (probably of type System.DateTime. And if you named LastExecuted it you would use code like the following to update the value:
Properties.Settings.Default.LastExecuted = DateTime.Now;
Properties.Settings.Default.Save();
I have a .jpg file which represents the current image from a webcam. User's will be downloading this file at an interval of once a second. Because there could be dozens of users reading it, this could be dozens of times a second (which is normal for any web server).
Problem is, this image is updated by a 3rd party application also once a second which "spiders" my local networks webcam portal image. This is so we can build our webcams into our current administration panel.
The problem I am already finding is ASP.net sometimes gets an error it can not access the file because it is open for write permissions by the bot. Likewise, the bot can not access it because IIS is feeding it to the user.
The bot uses io.streamwriter to save the data to the file, and my script uses Response.WriteFile to send the file to the script. (I need to use an actual ASP.net page with a JPG content-type that feeds the file to make sure only users with a active session can view the JPG).
My question is what is the best practices for this? I know why it's happening but what is the best resolution for this? Would storing as a BLOB in a database maybe be smarter since databases are created for concurrent read/writing already? Is there an easier way of doing this with a file I have not thought of yet?
Thanks in advance,
Anthony Greco
Using a BLOB will work if the readers use SNAPSHOT isolation model (SQL Server 2005 and up). See Download and Upload images from SQL Server via ASP.Net MVC for how to stream an image from a BLOB, and see Understanding Row Versioning-Based Isolation Levels for a lecture on SNAPSHOT.
But using a BLOB may be overkill, you could get away with something much simpler. For instance, if you only have one ASP.Net process, then you could have a global volatile variable for the current file name. The writer writes the JPG into a new file, and then updates the global 'current' file name with an Interlocked.CompareExchange operation (it has to be Compare because a newer writer might actually finish faster, outrun a previous writer, and you want to preserve the latest update). There are still some issues left to solve (find out the file name at startup, clean up old files etc) but they are all fairly ease to solve.
If you have a farm of servers, or multiple ASP.Net processes serving the site, then things could get complicated. I would still do a rotating file name and do a try-and-error approach (try to respond with newest file, fall back to previous older one if conflict is detected).
You could get the bot to write the data to a different filename and then do a delete and rename to the filename being served by ASP.Net. This should reduce the file lock time down to the time for a delete and rename to occur. To clarify:
ASP.Net serving image from "webcam.jpg"
bot writes image data to "temp.jpg"
when last image byte written, bot deletes "webcam.jpg" and renames "temp.jpg" to "webcam.jpg"
ASP.Net should check "webcam.jpg" exists, if not wait 10ms (or suitable small increment) and check again.