|
Oh, I didn't get they were going into a DB. Well, then change the code you use to read the file. I think File.ReadAllBytes works fine, but using streams does not work, from memory. It's a bug in the framework, essentially.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Christian Graus wrote: using streams does not work ... It's a bug in the framework, essentially.
I disagree. Creating a Stream from a path, without specifying the intended access, assumes read/write intentions. What else should the framework do?
|
|
|
|
|
Hi, I am trying to start an application from my application, which opens a default file, given it's arguments as follow:
Process prc = new Process();
prc.StartInfo.FileName = "azman.msc";
prc.StartInfo.Arguments = "msxml://" + Environment.CurrentDirectory + "\\AuthorizationStore.xml";
prc.Start();
Note the current curectory is:
CurrentDirectory = C:\Users\Hugo\Documents\Visual Studio 2008\Projects\AzManTest\AzManTest\bin
Which contains spaces. For some or other odd reason, it does not like this ...
If this directory is in such a location that there are no spaces in the Directory name, then this works fine...
Can I replace the spaces of the directory with something ? How can I fix this problem.
Any help would be much appreciated!
|
|
|
|
|
It's not odd, the space is used as a delimiter for arguments. Put the path in quotes to get around this.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
LOL .... thanks ^_^
prc.StartInfo.Arguments = "msxml://" + "\"" + Environment.CurrentDirectory + "\\AuthorizationStore.xml" + "\"";
Is this the way to escape a " character?
|
|
|
|
|
Yes. I believe that single quotes work as well, but that's how you escape double ones.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Good morning everybody,
I would like to know how to show in GridViewColumn of pictures of a table of database.
I explain me fill DataSet has leave a request SQL.
In my DataSet I have a column which contains of of the data of type Varbinary.
I would like to know how to show in GridViewColumn of pictures instead of of the data of type Varbinary.
If you can help me please.
Excuse me I am French my English is bad
|
|
|
|
|
Does this[^] help?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Good morning,
Thanks a lot for your help, I achieved show picture in a column of the gate in Asp. Net.
If I could make the same of example that you had me give in XAML the foot would belong.
Here is my code XAML for the Colourful billing of the column
<gridviewcolumn header="Image" width="100" displaymemberbinding="{Binding Path=MyImage}">
<gridviewcolumn.celltemplate>
<datatemplate>
|
|
|
|
|
Hi,
I'm having trouble to obtain the Roles, and the Operations etc. attached to a specific role.
I have a few operations, and a few roles. I want to Iterate through these roles and obtain the operations linked to these roles.
Now I know how to iterate trough these roles and operations individually ... But I don't know how to obtain the link between the two...
I'm using the AZROLESLib.
string storeAddress = "msxml://" + Environment.CurrentDirectory + "\\AuthorizationStore.xml";
AzAuthorizationStoreClass store;
store = new AzAuthorizationStoreClass();
store.Initialize(0, storeAddress, null);
IAzApplication app = store.OpenApplication("Abatis", null);
for (int i = 1; i <= app.Roles.Count; i++)
{
Microsoft.Interop.Security.AzRoles.IAzRole role =
(Microsoft.Interop.Security.AzRoles.IAzRole)app.Roles[i];
String roleName = role.Name;
}
for (int i = 1; i <= app.Operations.Count; i++)
{
Microsoft.Interop.Security.AzRoles.IAzOperation operation =
(Microsoft.Interop.Security.AzRoles.IAzOperation) app.Operations[i];
try
{
String val = operation.Name.Replace(" ", string.Empty);
}
catch (Exception ex)
{
}
}
I can't find the link ... There is an Operations field if you open the roles as follow:
IAzRole roleVal = app.OpenRole(roleName, null);
roleVal.Operations
But I can't iterate through them.
Any help would be much appreciated!
|
|
|
|
|
bonkers123 wrote: I'm using the AZROLESLib.
You probably need to talk to whoever wrote that library then.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
This is a standard Windows (COM) Library ...
modified on Tuesday, May 5, 2009 5:15 AM
|
|
|
|
|
I'm having exactly the sample problem - no operations are shown for a given role.
Seems like a bug to me....
|
|
|
|
|
I am also facing the same problem. has anybody got the fix or is it a known bug?
Is there a workaround for accesing the operations associated witha specific role in Azman?
Also, documentation at this link
http://msdn.microsoft.com/en-us/library/aa375751(v=VS.85).aspx[^]
mentions that there is an interface "IAzRoleDefinition" which I thought of using but this interface is not available in the API for the interop assembly version 1.2. Has anybody faced similar problem?
Please please reply!!! Need a solution quick. Any response is greatly appreciated.
|
|
|
|
|
Hello everyone need yr help once again,
I need to deploy an Application but along with that i need to register few dll's. I have a C# process in install method of custom installer that runs a bat file containing commands to register dll's like
regsvr32 /s "First.dll"
regsvr32 /s "Second.dll"
.
.
.
regsvr32 /s "nTh.dll".
the installer is running successfully on Xp but failed to do it on Windows vista.
giving following exception..
“The Installer has encountered an unexpected error installing this package.
This may indicate a problem with this package” Error Code :2869."
I checked the root cause and it is with the running C# process.
But as i have n't know anything about Windows Xp , i am unable to rectify the issue.
It will be great if you help me in this Issue.
Thanks & Regards
Dattatraya
|
|
|
|
|
you need admin rights to register a dll. Welcome to the hell that is vista.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
thanks a lot for yr reply but how can i get admin rights to register those dll's programatically ..
|
|
|
|
|
The user needs to choose to run the app as admin, or I believe you can set up the manifest file to specify that such rights are required.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi all!
I have gotta small dilemma in proceeding with my project. I thought it would be better to ask the gurus to sort it out in their own fashion...
Here it goes...
I am developing a small consoleapplication, which is used to fetch data from a distance server.
The details of "which" data to be fetched is given as a command line option. I have several such commands and everything was working fine. But now, for some reasons i want to restrict the usage of certain commands, i.e., much similar like a basic user and admin user level. Admin user can use all the command options whereas basic user can use only non-restricted commands.
For this, I have created two attributes named "admin" and "basic" and applied to the corresponding commands. The attributes need to compared with the user level configuration.
Now how do i make the application to differentiate the user rights??
option 1: Have a XML config file with a "user level" field and read the XML file in the runtime and allow access...
option 2: have a shared dll file with a "user level" property and read the dll during runtime and allow access accordingly....
Note: The main requirement is that user rights can be upgraded and downgraded from "basic" to "admin" and vice versa just by modifying the configuration entries...
Please suggest, which one to use and if any other better option too....
Have a Happy Coding.....
|
|
|
|
|
The trouble with XML is that it's human readable and easy to change, if someone wants to give themselves admin rights.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
yes obviously....
That is the reason why i keep on scratching my head.......
Have a Happy Coding.....
|
|
|
|
|
You could use a mechanism where you sign the xml with a certificate (private key). Within your dll you can check the signature of the xml (public key), to check that the xml was modified by you. This will let you take the advantages of xml when a user upgrades (better than using a dll that you have to compile).
Regards
Sebastian
|
|
|
|
|
Thank you sebastian!
Oh!! That really thrown some light!!!
Thanks again...
Have a Happy Coding.....
|
|
|
|
|
what is the use of get set properties in C #
|
|
|
|
|
Properties are a better way of controlling your private member variables.
get and set accessors are used to facilitate this access control.
assume you have a private member
private int count;
Now you want to assign some value to the variable and need to read it whenever required.
You can safely reveal your count variable to external world using a property declaration like this:
public int Counter
{
get
{
return count;
}
set
{
count = value;
}
}
"There are a few reasons to use properties, instead of public fields. One is that properties can be virtual. Another is that you can make the setters for a property private. Another is that properties have a 'special' meaning to things that inspect classes at runtime. There are frameworks for conveniently talking to databases and for reading and writing objects to and from XML and all sorts of other things -- and they automatically look at the object's properties (and not private fields or other things) to see how to do their job."
For better clarification i would suggest you to buy a C# book and spend some time in learning the basics..... rather than asking the same in the forums.....
Have a Happy Coding.....
|
|
|
|