|
Hi, I need a suggestion on securing a database. I have a table which has new values inserted by importing a csv file. These rows are then marked as used, when a client uses a voucher number associated with that row. I have a hash value for each row which ensures that a user cannot just reset its used status.
However, I realise that a user could very easily just delete that row and reimport it. I know this cannot be stopped, but I just need some suggestions on how I could ensure they are not doing this. DB level security will not work, as each computer which will use this app is standalone, and the owner of the computer will have all rights to the db through the SA login. Can I block the database owner from modifying the table?
|
|
|
|
|
Either parse the input and block on any violations according to your requirements, or realize that if the user has SA privileges there's nothing you can do anyway.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
|
Hi, I am interested in your idea, but not to sure what you mean. Would the trigger be used to prevent an update?
|
|
|
|
|
|
I have multiple printer drivers installed (e.g. EPSON, RICOH, CANNON) on my computer. Is there any way to check/get the PrinterSettings of any of them using Printer Name? i.e. if I want to check EPSON printers PrinterSettings that may not be the default printer, how to do it?
Please guide
|
|
|
|
|
Use the static PrinterSettings.InstalledPrinters collection property to get a collection of the printer names. You can enumerate this collection, or if you know the name of the printer, you can set PrinterSettings.PrinterName , like in the following example:
PrinterSettings printer = null;
foreach (string name in PrinterSettings.InstalledProperties)
{
printer.PrinterName = name;
if (printer.IsValid)
{
}
}
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
thanks for the reply.
continuing the same topic;
How to set any one of Printers as Default Printer?
regards
|
|
|
|
|
The easiest way is through WMI. While on NT-based platforms you can make a single function call (you have to P/Invoke SetDefaultPrinter ), the steps for Windows (i.e., Win98 and ME) platforms are more numerous.
WMI exposes a Win32_Printer.SetDefaultPrinter method that abstracts the correct implementation:
using System;
using System.Management;
class Printers
{
static void Main(string[] args)
{
EnumeratePrinters(args.Length > 0 ? args[0] : null);
}
static void EnumeratePrinters(string defaultName)
{
ManagementObject defaultPrinter = null;
ManagementObjectSearcher searcher = new ManagementObjectSearcher(
"select * from Win32_Printer");
foreach (ManagementObject printer in searcher.Get())
{
string name = printer["Name"].ToString();
Console.WriteLine("Printer: " + name);
if (defaultName != null &&
string.Compare(name, defaultName, true) == 0)
defaultPrinter = printer;
}
if (defaultPrinter != null)
{
Console.WriteLine("Setting default printer to \"{0}\"",
defaultPrinter["Name"]);
defaultPrinter.InvokeMethod("SetDefaultPrinter", null);
}
}
}
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hi~
I am writting a program to get the email using MAPI by P/Invoke.
Except inbox, Can I get the emails item from other folder such as outbox?
Thanks
|
|
|
|
|
hi,
how to preprocess "ctrl + c" in console program,i want to using .net class implement this function.
thanks
|
|
|
|
|
Each time I try to create an ASP.NET Web Application I get the "Web Access Failed" dialog box...IIS is installed and running correctly, however I keep getting the following error message:
<br />
The default Web access mode for this project is set to file share, but the project folder at 'http://localhost/WebApplication1' cannot be opened with the path 'c:\Inetpub\wwwroot\WebApplication1'.
Can anybody explain why i keep getting this? IIS is running correctly and so are the rest of my Visual Studio .NET applications...I only get this when I try to create Web Applications...
Thanks
|
|
|
|
|
This may happen if you are not exceuting your application in Administartor or same privilaged environment. Try to execute your web application in Administrator mode. If it is not serving your purpose try to post in Asp.net thread.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
Hi all,
I got this C++ dll that comes with a input/output card, How do I import and start using this in C# . Do point to any useful reference . Thank You
|
|
|
|
|
Consuming unmanaged components and .dlls are very easy in .Net Framework. Please go through Interop and P/Invoke technologies of .NET.
P/Invoke and Interop
Sreejith Nair
[ My Articles ]
|
|
|
|
|
Thank you very much. Very useful link
|
|
|
|
|
Hi,
I want to make my application to support 2 or 3 languages. But how can I make a good and convenient localization kit for my applucation?
I have no idea to make it, could anyone suggest to me or give me some example?
thanks a lot !!!
|
|
|
|
|
|
how can I prevent window1.show() from showing same window multiple times.
Are there any command like..
if (window1 exists)
don't open window1
thanks
Sudeep
======
code proj. rocks!
|
|
|
|
|
You can use a static field to keep track of the window state. When the window opens set the field to true. When the window closes set it to false. Check the field before trying to show another copy.
Another way is to just to use ShowDialog() I don't know if that works for you.
|
|
|
|
|
Hi all,
How can I use c# to manipulate the favourites in Internet Explorer, e.g.
import and export favourites from the IE ?
Thanks
Patrick
|
|
|
|
|
Favourites are just stored as text files in your profile
e.g. C:\Documents and Settings\[your profile]\Favourites\
Open one of the files in notepad and you'll see the format is fairly straightforward, so it should be pretty simple to write code that'd read each file in, parse it, and store it in some kind of tree structure
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
You should never hard code paths when there's better alternatives. In this case, you can use Environment.SpecialFolder.Favorites . See my previous post for details.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Ahh, even better - yeah, I knew favorites are stored in all sorts of places - I was just giving the guy a starting point
(I assume that'll give the right path on Win95 systems that stored favorites in the c:\windows\favorites\folder\ ?)
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
The .NET Framework isn't supported on Windows 95, and Windows 95 hasn't even been supported in general by Microsoft for a couple years now.
On supported platforms (at least on Windows), however, the correct path is returned.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|