|
Subin Mavunkal wrote: Only USB manufactures can do that..i guess.
Guessing is a bad form of answering. If you read my post you would have seen two options for the specified scenario.
Bastard Programmer from Hell
|
|
|
|
|
First let me try to translate the subject of your message for those who neither speak Spanish nor are willing to accept #2 of "HOW TO ANSWER A QUESTION":
"How to protect an XML file so that it cannot be deleted from the computer"
A very simple solution is to make the file hidden (see file attributes http://msdn.microsoft.com/es-es/library/system.io.file.setattributes(v=VS.90).aspx[^]). Of course, that's simple and the user can easily find that out.
You can make it more difficult for the user when you write a Windows service. That would run with "Local System Account" and thus has different access rights to files. A user with admin privileges could still delete it.
|
|
|
|
|
Hi,
I have an application build with VS2005 + SP1 on Windows XP + XP SP 3. This application simply copy a file from some folder to "C:\". When I copy my release build .exe from XP machine to Windows 7 machine. It does not copy the source file to "c:\" I am using following code to copy my file.
class Program
{
static void WritetoLog(Strings)
{
System.IO.StreamWriter file = new System.IO.StreamWriter("D:\\Test\\CopyFileApp.log", true);
file.WriteLine(s);
file.Close();
}
static void Main(string[] args)
{
try
{
File.Copy("D:\\Source.txt", "c:\\target.txt", true);
}
catch (Exceptione)
{
WritetoLog("got Exception");
}
}
}
Surprisingly, there is no exception on Windows 7 and neither there is file copied. Please let me know what is wrong here and if there is any workaround to this. If I build the same application using VS2008, I get an exception on Windows 7. I am working on a big application and can't move to VS2008.
|
|
|
|
|
System.IO.StreamWriter file = new System.IO.StreamWriter("D:\\Test\\CopyFileApp.log", true)
This is your issue. Your StreamWriter is set up to write to D:, not C:
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
The problem is not with StreamWriter. It is with File.Copy
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
|
Does D:\Test exist? If not, your logging code will fail and the whole thing will exit with an unhandled exception.
|
|
|
|
|
Yes, it exists. It is clearly mentioned that the problem is with File.Copy
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
|
I suspect that Windows 7 doesn't want you to write to the root of the C: drive.
|
|
|
|
|
|
You can use following code to check the access for a folder:
using System.Security.AccessControl;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
DirectorySecurity ds = new DirectorySecurity("C:\\", AccessControlSections.Access);
bool isProtected = ds.AreAccessRulesProtected;
}
}
}
Thanks,
Manish Agarwal
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
|
|
iam creating rdlc with chart in asp.net 4 web site
my rdlc dir items & total item sales in duration
if i dir for long duration i have problems that all items not dir because i group them with item name
so item name dir under each column
i think if the group axis is dir vertical it 'll solve my problem
but i don't know how to do that
or if there si any other solution to my problem
thanks
md_refay
|
|
|
|
|
What the heck is an "rdlc"?
|
|
|
|
|
A client report definition file.[^]
I've seen enough of these things to know I never want to get suckered into reporting. That said I always thought reporting the boil on the backside development, but without the satisfaction of being able to have it lanced.
|
|
|
|
|
Ive made two databases in SQL server. One contains some general information about user and the other contains some specific information. In both of them the common key is username.
How to merge these two databases in C#??
Ive searched on google but I am not getting any useful information regarding this...
Plz help...
|
|
|
|
|
Without more detail, it will be impossible to give a detailed reply. Maybe just replicate the tables of the details database in the users database and transfer the data across, keeping the common key intact between the two.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Okie
I have two databases in SQL server. The first one(db1) contains information such as username, password, address, phone no etc and the other one(db2) contains information such as username, education, key skills, hobbies etc. The username is the common key between the two.
Ive made two pages in asp.net website for registration. First one has a form with fields username,password, address, phone no. The second one has a form with fields as education, key skills, hobbies. The code is in C#.In the code behind of second form, I want to compare that if the username from db1 is equal to username from db2, then fill in the details in the database(db2). How to accomplish this task ?
Thnks
|
|
|
|
|
What you're describing is a table, not a database. Do you have two databases each of which has one table? (If so, why ?) If so, you first need to decide which database is going to back onto your web app and move both tables into that one. The web app should not need to talk to two databases. Do the merge once, manually, and have your code look at only one database.
Any registration process for the same website should populate the same users table – that's what you're going to use to verify login attempts. That means that the second form either needs to run from an already verified login session (kind of like filling out extra profile information on a forum), or it needs to create a row in the main users table. If there is a one-to-one users:extra_information relationship then it is a matter of style whether to make those extra columns in the users table or a separate table with a foreign key relationship, but you must have a row in users, for sure.
|
|
|
|
|
Okie I get it!
Thnk u so much
|
|
|
|
|
This is really a DBA task and not a C# task. I think you'd be better off speaking with a DBA.
|
|
|
|
|
I've to write that code in C#. That's why I asked it in C# forum.
|
|
|
|
|
Are you simply looking to JOIN the tables in a query?
|
|
|
|
|
I guess ya to join the tables...I've to write a C# code for that.
|
|
|
|
|
Hi..,
I need to debug the Dll built in Debug mode.
Here i can launch the Debugger but how to give the Code path and Code because all what i has the Dll's...,
Could you please suggest some idea's..
Thanks
-
Biradar
|
|
|
|
|
Nyanoba wrote: Here i can launch the Debugger but how to give the Code path and Code because
all what i has the Dll's...,
Do you have the code base with which the dll was built?
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|