|
i'm trying to create a code group for CAS, i created a key file using sn.exe. and assigned that key to the assembly using
[assembly: AssemblyKeyFile(@"C:\caskey.snk")]
and built the project. but when i'm trying to create the code group using the strong name by importing the assembly file it says "The import failed. the assembly does not appear to be valid"
can any one tell me what might be wrong...
|
|
|
|
|
thanx for all who worked on solving my problem, i found the cause, it was version incompatibility.
i used the vs 2008 and framework 2.0 and the mscorcfg.msc was framework 1.1 ,that was the cause ..
|
|
|
|
|
Hi,
How to get a list of all the shared folder and get the share permission for each one?
I tried to use ObjectQuery query = new ObjectQuery("SELECT * FROM Win32_LogicalShareSecuritySetting");
But the line of code above does not return shared folder created by code. If i manually create the folder and set it as Shared folder through windows, the shared folder can be obtain from Win32_LogicalShareSecuritySetting. Just for information, the share and security setting for both folder created through code and manually created is the same. But if the shared folder created using code, it fails to return using Win32_LogicalShareSecuritySetting.
If i use Win32_Share, i'm able to get all the share folders but the problem is i cannot use the method ("GetSecurityDescriptor") below to obtain the AccessMask or the share permission information. It will throw exception because GetSecurityDescriptor is not a method under Win32_Share:
ManagementBaseObject outParamsMthd =
m.InvokeMethod("GetSecurityDescriptor", null, options);
Below is the code snippet to obtain shared folder permission information for user name "Everyone"
ObjectQuery query = new ObjectQuery("SELECT * FROM Win32_LogicalShareSecuritySetting");
ManagementObjectSearcher searcher = new
ManagementObjectSearcher(scope, query);
ManagementObjectCollection queryCollection = searcher.Get();
foreach (ManagementObject m in queryCollection)
{
string shareName = m["Name"].ToString();
string shareLocalPath = ShareManager.GetShareLocalPath(shareName);
Console.WriteLine(shareLocalPath);
if (folderPath == shareLocalPath)
{
InvokeMethodOptions options = new InvokeMethodOptions();
ManagementBaseObject outParamsMthd =
m.InvokeMethod("GetSecurityDescriptor", null, options);
ManagementBaseObject descriptor =
outParamsMthd["Descriptor"] as ManagementBaseObject;
ManagementBaseObject[] dacl = descriptor["DACL"] as
ManagementBaseObject[];
foreach (ManagementBaseObject ace in dacl)
{
ManagementBaseObject trustee = ace["Trustee"] as
ManagementBaseObject;
string domain = (string)trustee["Domain"];
if ((string)trustee["Name"] == "Everyone")
{
UInt32 mask = (UInt32)ace["AccessMask"];
string enumMask = System.Enum.Format(typeof(Mask), mask, "g");
if (enumMask.Contains("WRITE"))
{
return true;
}
}
}
}
Thanks in advance
modified on Thursday, January 21, 2010 11:17 PM
|
|
|
|
|
I am sure this is an easy fix, I am not able to run any C# program, that i have compiled at home, on my work machine. I have previously been able to run them on other work computers but this one i cannot. It is a pretty crappy computer running XP. I am sure that it is just an update i am missing. It seems to have .Net 2.0. Can anyone help?
|
|
|
|
|
viciouskinid wrote: It seems to have .Net 2.0.
If you're not sure, you have to make sure. Navigate to C:\Windows\Microsoft.NET\Framework and look to for the folder names. Each will tell you which version of the framework is installed.
You also didn't say which version of Visual Studio you used to write your apps. If it's 2003, then you have to have .NET 1.1 installed. If 2005, .NET 2.0. If 2008, then it depends on your projects settings. 2008 can target 2.0, 3.0, and 3.5.
|
|
|
|
|
You might be referencing a third party dll (not MS) or something which is available on your home computer but not on the 'crappy' one.
Now...bring me that horizon. And really bad eggs...Drink up me hearties, YO HO!
|
|
|
|
|
|
Try to make you're project in .NET 3.0
I have the same issue at a moment, and this solve it
|
|
|
|
|
hi
i have some visual-studio 2008 question
1. is VS2008 can open VS2005 projects ?
2. is it be possible to install VS2008 on mini laptop ? (intel atom, 2G DDR)
3. if VS2008 isnt work, is it take any resource ?
thank's in advance
|
|
|
|
|
1. Yes (it coverts them)
2. Yes (but it may run a little sluggish)
3. No, only drive space.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I have VS2008 Express Editions running on a 1GB atom N270 netbook; yes, the CPU power is limited, however the limited screen size is my main concern for extensive work; such netbook is fine for applying code modifications in the field.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
If you install SQL Server with it, it may take some memory if the server starts automatically. However, you can turn that off using the configuration manager.
|
|
|
|
|
|
hi, in cyber-cafe software I'm currently working on, I store order information in sql. There are some other information that needs to be stored (like; time,duration,price,cash,on/off,total charge AND configuration settings etc.) I look for the best practice without sacrificing the performance. Is the best place to store them Registry, Sql or other?
Thanks in advance
|
|
|
|
|
if its lan, saving it on sql won't hurt.
I have worked on wan operations. The only problem in lan connections happen when this lan is vpn.
|
|
|
|
|
I'have got nothing to do with lan fortunately, sql and my program will be on the same machine. So the thing I wonder is, is it ideal to store everything in sql or is there a rule that says; configuration settings should be kept in bla bla... and x information should be kept in.....
|
|
|
|
|
there is no rule. but you should consider scalability.
As you just mentioned, that your sql data would be on the same machine... in this case, even a file system could handle it. However, you chose sql because of future possibilities.
Similarly, to save configuration info, there are a few things that can be considered.
usually, configurations are of two types:
1) global - any changes affect all users.
2) local - any changes affect only current user.
global configurations are like rates, prices etc.. which are obvious to be common to all.
local are like colors, size, font, viewing preferences etc.
Now, global should be saved in sql as it has to be accessed by all.
local can be saved either in sql with a user_ID or can be saved in local user app data file. you can use Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
I personally prefer keeping everything in sql. any user can login from anywhere and have his configuration available.
(if you like the answer, rate it)
|
|
|
|
|
Som Shekhar wrote: (if you like the answer, rate it)
+5
I are Troll
|
|
|
|
|
teknolog123 wrote: sql and my program will be on the same machine.
Okay - Why? What is the purpose of your program? And how does the cyber café owner/management communicate with each individual machine about usage and who's assigned to it (or which access ticket is in use), etc.
|
|
|
|
|
teknolog123 wrote: or is there a rule
We try to forget about those, and have decided to go with whatever works
I agree that a database would be the suitable place to store data on a network. If you don't have a server, I'd choose XML; gives you the advantage that you don't need to install SQL just for storing the application-settings, and you can edit it with any editor.
There's also INI-files, and yes, the registry is an option too, albeit one might need admin-rights to modify some keys. A nice option would be to store the settings online, so that they'll persist even after a reinstall.
I are Troll
|
|
|
|
|
I'd say that you should be storing this in the database (SQL Server). That way you can control configuration from a central location and the usuage data from the individual machines is also stored centrally. Remember you have to think of the performance of the administration side as well as the individual user side. The overhead of using a SQL server is minimal.
You also mention storing the information in the registry - How were you going to retrieve this information? While it might be a good location for some of the configuration information I don't think it is a good location for storing commerce information (price, usage times etc.)
|
|
|
|
|
|
You can use Application Settings (Project|Properties.)
Dr. Sandy
It's never too late to become the person you were meant to be.
|
|
|
|
|
Avoid the registry at all costs.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
hi guys...i have a problem as usual...actually an error that i have never seen before..i have two radio button in my form i use one of them to add customer and the second one to add company...while adding company no problem..i can make adding process..but while adding customer i have got an error on the screen by messagebox error says that :
"No mapping exists from object type System.Data.DataRowView to a known managed provider native type."
i have these codes to add the customer
cmd = new SqlCommand("insert into XXX(ad_syd,firma,sektor,grup,cep_no,is_no,ev_no) values (@ad_syd,@firma,@sektor,@grup,@cep_no,@is_no,@ev_no)", con);
cmd.Parameters.AddWithValue("@ad_syd",info.ToTitleCase(txtAdSyd.Text));
cmd.Parameters.AddWithValue("@firma", cmbFirma.SelectedItem);
cmd.Parameters.AddWithValue("@sektor", txtsektor.Text);
cmd.Parameters.AddWithValue("@grup", txtGrup.Text);
cmd.Parameters.AddWithValue("@cep_no", Birlestir(txtCepKod.Text, txtCep.Text));
cmd.Parameters.AddWithValue("@is_no", Birlestir(txtKod.Text, txtisTlf.Text));
cmd.Parameters.AddWithValue("@ev_no", Birlestir(txtEvKod.Text, txtEvTlf.Text));
if ((txtisTlf.Text != ""))
{
if ((txtAdSyd.Text != ""))
{
if (cmd.ExecuteNonQuery() == 1)
MessageBox.Show("Ekleme İşlemi Tamamlandı", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
else
MessageBox.Show("Ekleme Sırasında Hata Oluştu", "Dikkat", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
MessageBox.Show("* İşaretli Alanlar Boş Bırakılamaz", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
MessageBox.Show("* İşaretli Alanlar Boş Bırakılamaz", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
i replaced a breakpoint but it doesnt enter if (cmd.ExecuteNonQuery() == 1) that line...it goes to catch block directly
what can be the problem ??
|
|
|
|
|
I can't see your code well as it misses formatting (read my sig!).
If you catch an exception, look at its ToString() information and you should be able to pinpoint the problem yourself.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|