Where is Safe to Save My Important Files? [closed] - c#

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I work on C# project.
In first run of my application SQL Server 2008 wants to create a database, and I wanted SQL Server 2008 to create the MDF file in Programs Files. But Windows(XP) doesn't let me (or SQL) create the file and shows "Access is Denied" error.
Where is a safe place to save My MDF file? Is "Application Data" folder a safe place? Do I have permission to make a file in this folder? Or is there a better place to save my file?

I have a solution to your problem. If you are going to develop for a specific target environment, you have to have a measure of control over the environment, or have contacts with people in your organization who do. It's that simple. YOU have to make this happen, one way or the other. You should have identified this in the early analysis and design phases of your project. Someone should have said, where are we deploying code? Where are we deploying the database? Do we have the permissions to do that? If not, who do we talk to that does? How much lead time to we need to make the request so the group XYZ can deliver in time? What management will need to approve this? Do new global groups need to be created. And on and on. The Stack Overflow community cannot answer these questions for you, because we don't know your organization, and environment. YOU DO, or at least you should. Or at least you should know who to ask so that you can know. What kind of development is this, where you, the developer can't copy a file somewhere? Where is your deployment plan? Why haven't you talked to your helpdesk or sys admins? If there are none, then give your admin rights to the PC in question and do as you please. It doesn't really matter where it is, as long as doesn't invite too much scrutiny (like in the root). YOU HAVE TO OWN THIS, or get buy in from those who do control who has access to which directories. Hopefully you will not take this as me jumping on your case, but just trying to give you a real perspective. I have worked for a number of companies, and there are always little fiefdoms, where certain people control certain resources and you have to navigate the maze. But do just that, and get the job done. This is why you are getting so many downvotes. You are overlooking something extremely obvious - instead of looking outward to Stack Overflow, this is something that you should be querying people inside that space where you are trying to deliver. I hope this helps.
All else fails, install SSMS Express and set up the db that way, and use (local)\SQLExpress in your connection string, and kill the mdf option, then uninstall SSMS. A lot of work, but it will get you results. Make a way. Good luck.

Related

creating demo version of c# windows application [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I have coded a software which is a windows application in c#.
I wish to create a demo version of my software. How can I use a timer so that the installed software runs for a definate period of time ?
Also is it possible that even if the user machine is formatted, the application wont install after my preset time is exhausted ?
How can I use a timer so that the installed software runs for a
definite period of time ?
You create your own hashing function which generates license key, here one of the components of the key is a final day. So you save that key into a file, and on every start-up check the value present inside it against the actual value of date on PC.
Pro: Easy to implement and put in production
Cons: Easy to hack. Just enough to cheat the DateTime settings of OS.
Another option: you can use some licensing software:
Look here on possible options: Licensing System for .NET
Another again: some web service where you check the data (avoid client side data cheating)
Another again: is limit demo version not on time, but on functionality (limited features are available, you can save data on disk limited amount of time, you can run application limited times... and so on)
Also is it possible that even if the user machine is formatted, the
application wont install after my pre-set time is exhausted ?
no, it's not possible, as formatting means data complete erase.
If you're not going to connect the application to a server-side registration mechanism (which I wouldn't recommend), then you can place a value in the Registry that you use to determine when the trial started. Subtract that value from the current date and time when the application is loaded and you'll be able to determine when it should stop. However, this is not safe from a format or hacking.
My recommended solution is to for server-side registration of the trial software during the first load. This will allow you to ensure that even if they reformatted the drive they couldn't get past the registration. Though this still isn't fool proof because they could register under many aliases, it's at least a lot more trouble. One remaining issue with this idea is what happens if they aren't connected to the internet? Are you going to stop them from using the application? You could couple this idea with the first one and leverage the Registry if they don't have an internet connection.
Either way, preventing people from hacking your registration process is difficult at best. Microsoft has struggled with it since their inception.

Why My C# program runs on my Pc but not in other computers? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I used C# language in visual studio 2008 and some SQL server management databases in my program
but here in my computer the program runs well but in other Pcs it just can't be run :(
The error is "The application failed initialize property(0Xc0000135). click on OK to terminate the application"
Why this error happens ?
Without more details this answer is virtually impossible to answer. Here are a few things to check/try ...
Run the program on your PC outside of visual studio
Make your database available on the same network your client PCs are on
If this is indeed a networked installation, make sure you can ping the server from your client PCs
Make sure you've enabled remote connections to your database
Make sure your firewall isn't getting in the way of database connections
If you're still experiencing problems you should consider adding logging of some kind to your application (this is a good thing to do regardless of any problems you're experiencing) so you can find out at what point your application is failing. If you are getting error messages, posting those messages here will help us figure out what the problem is much more quickly. Also, if you can, put some code into your question so we can see what it is you're trying to achieve
make sure your database is available on the network, and change to use sql authorization.
You could go to SQL Management Studio on your local PC. Create a public user account or pub account under security and add public and connect permissions to that given user.
If you are on a domain, and want to use Windows Authentication add the user accounts for the Windows Users to that Database Security. Either option will work.
Are you using WinForms or Web App? For Web apps, verify your sh*t in web.config, and make sure your connection string is legit. Make sure you change your authentication to Windows or Forms, based on what you decide to do.

What happens if I post to a site a million times repeatedly? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I was just trying to post something to a website via my localhost to retrieve some data, and suddenly, this idea came to my mind: What happens if I create a post, put it into a for loop that runs over 1 million times, and send requests to a specific url for a million time? I just did not want to try to avoid any harm, but I wonder. And if this could cause some harm, how can I avoid such an attack?
this kind of things actually happen a lot. some are intentional and some are not. take for example: http://en.wikipedia.org/wiki/Slashdot_effect
other times, this is intentional, and its called a DoS (Denial Of Service). a lot of websites are taken down with these attacks, and not always involve an actual connection. it may suffice to saturate the listen backlog of the underlying os.
how to avoid it.. you cant, basically. you can make the best effort at it, but you will never be able to actually avoid it. after all, your website is there to be accessed, right?
You could add a rule in your firewall to block a specific IP address if that were to happen. If it is a sophisticated denial of service, I'm sure the IP address is spoofed and will be random. But for normal web sites, you won't need to worry about this.
Well, the server will get progressively bogged down until it figures out how to handle all 1,000,000 of those requests. Odds are, unless you have legendary hardware, it will become unresponsive and next to useless, creating a great disruption to everyone wanting to access it. This is called a Denial Of Service attack, or a DOS.
There's a few things you can do to prevent this:
Require users to verify that they are human before the server will process their request. This is usually done with Captchas.
Use an intelligent firewall to drop the packets or figure out how to have the server ignore requests from IP addresses that have been sending too many.
Make sure everybody loves your site so much that they wouldn't even think of doing anything to hurt it.
1 is probably most effective and simplest to do, and 3 is impossible. I can't offer a lot of advice about 2 due to lack of experience, and its probably fairly difficult and easy enough to exploit.
Short Story: Go with a Captcha. ;)

Editing Website and Viewing Orders [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
This'll be my second time doing a CMS and Inventory Management app for my client. This particular client wants it all to be online. Instead of a desktop app, like I did with my previous client. Which is fine I guess, however I'm a little concerned about the security stuff... What if it gets hacked? He basically wants to be able to manage, view, create new and edit existing orders via his website from an "Admin" type interface after he logs in as an Admin, so obviously I'm going to need Roles.
But is this common or normal practice? The website isn't an intranet, or hosted locally, it's remotely hosted.
Yes, its very normal all of my websites have admin interfaces that allow access to just about everything with the proper credentials.
A word of caution however: If you are not sure what you are doing, I'd be very careful about accepting/storing credit cards or other sensitive information(SSN's medical data etc) . Its easy to screw up, and if that stuff get hacked, you may have some serious legal problems to deal with. Consider hiring someone with the right experience to help with security.
Everything you listed is normal to a Web application, whether it's hosted locally or on an intranet, or hosted remotely.
What you need is probably already implemented in other online CMSs (see Orchard CMS), but if you want to roll your own CMS, it's very easy to use ASP.NET MVC; it also has easy integration with Forms Authentication for ASP.NET.

run software even without windows [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
is there any way to make a software , so if the user reinstall windows or format disk drive , the software will run without installing automatically .
I do not mean a software that do not require installation .
think a user install this software , this software automatically run . one day user format hard disk and install a new windows . that software run automatically without installing .
Theoretically yes, but the question to ask is, "where is the executable for this program stored?"
Normally programs are stored on the hard disk, so if the user formats it, the program is gone[*]. So the question is, "where else can code be stored?"
The answer is that, in theory, you can replace the machine's BIOS. This is a very abnormal thing to do, though, it requires all the admin privileges in the world, and the BIOS program can't be very big.
It also can't be written in C# or C++ in the usual Windows-y ways. Firstly the BIOS runs before Windows is running, that's the point. Secondly removing the OS removes the libraries that Windows programs rely on, so if the system drive has been formatted and Windows not re-installed, there's no way to launch Windows and hence no way to start your Windows program.
[*] Boot sector viruses are way out of fashion.
If the user formats his hard drive and powers off his computer, there is no software left on the system that could be run.
No, this cannot be done (unless you re-flash the BIOS).
You can make it portable. Thus you can copy executable on non-system partition and it will still work.
But I dont think there is any way to register this application in fresh windows instalation without modifying the instalation process itself. But registration for autorun is easy and can be done when user first runs application manualy.

Categories