|
Armand,
I will try that, thank you!
Carl
|
|
|
|
|
Hi all. I know this is not C# specific but it is the language I am using for this project.
In my application I am setting permissions to several folders. Problem is, my app needs to run in 12 different languages. These permissions needs to be given to standard windows groups like 'Administrators' and 'Users' which change in every given language. Only solution I have found so far is to use a utility like this to give the permission based on the SID, which is constant for the standard groups given any OS language.
So is here any way in the framework or as an alternative an API I can call to get the localized name of the standard user groups?
Thanks!
Juan Miguel Venturello
|
|
|
|
|
Hi,
I am trying to convert the long integer (ex: 8837225770433) into character array.
But I am getting the following error.
"Value was either too large or too small for a character."
I am trying to convert the C++ logic to C#.
<br />
unsigned long* pTemp= reinterpret_cast<unsigned long*>(szBuf+(n-1)*4);<br />
*(pTemp) = hashRand.GenRandom() ^ lBuf[n];<br />
TIA
Dy
|
|
|
|
|
In C# you can do:
long value = ...;
char[] chars = value.ToString().ToCharArray();
that is if you want char array for 123 to hold '1', '2', '3'
|
|
|
|
|
well, he means byte (8), not char (16)
|
|
|
|
|
He said character array, not byte array.
|
|
|
|
|
Does C# have the C++ equivalent of a friend class?
I have a class where I want to prevent all by one class (in the assembly) from calling certain methods. In C++ I'd declare them protected and then make that one class a friend. Am I out of luck with C# as I suspect?
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Sadly no, and I was only lamenting the fact last night. Remember, C# is also supposed to attract VB programmers, so a lot of things that can be useful for a good programmer are missing because they are a danger to idiots.
In my case, I wrap an event in a class, and I wanted to only allow the class that sends events to be able to construct them, so that they were then unable to be modifed by clients. I can make it so a client must create a new event, they cannot modify the one they have, but I cannot hide the constructor.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I came across of this few times too.
Best thing I could come up with was to inherit:
class A
{
protected int x;
}
class ToolsForA : A
{
public int DoSomethingWithX(A a)
{
... can access a's protected members here...
}
}
|
|
|
|
|
The only way of doing something similar to C++ friend classes is by isolating your classes in an assembly (e.g., a DLL), and use them as 'internal', which makes a member public only to an assembly.
Yes, even I am blogging now!
|
|
|
|
|
I think it's internal .
/\ |_ E X E GG
|
|
|
|
|
Does anyone know how to display printer properties dialog?
It's the one that show when you click "Properties" from PrintDialog next to
dropdown with printer names.
I have printer name and need to display it's properties dialog without
showing PrintDialog or PageSetupDialog
|
|
|
|
|
i have a lines of code just like the following and i whould like to jump after checking a specified condition and incressing the i ... somthing like that ...
<br />
for(int i=0;i<=10;i++)<br />
{<br />
if(ok)<br />
<br />
<br />
}<br />
how can i do something like that...
ADEL K Khalil
|
|
|
|
|
I think you want the continue keyword.
Michael
CP Blog [^]
|
|
|
|
|
|
Hi!
I've got a problem and would be thankful for some help!
I can't open more than approximately 200-300 files.
When I have chosen the files and pressed OK this row throws a System.InvalidOperationException.
if( _openFileDialog.ShowDialog() == DialogResult.OK )
{
...
Does anyone know what I'm doing wrong?
Thanks!
Erik
|
|
|
|
|
hi,
Tell me how you select more than a file using OpenFileDialog class. Is it possible to show me that code. I need to know how did you code that.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
You can do this by simply setting the Multiselect property of your OpenFileDialog instance to true .
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi!
Sure, here's the code:
_openFileDialog.Multiselect = true;
if( _openFileDialog.ShowDialog() == DialogResult.OK )
{
string[] keys = _openFileDialog.FileNames;
...
/Erik
|
|
|
|
|
Don't read much .NET class documentation, do you? Set the Multiselect property of the OpenFileDialog object to true before you call ShowDialog .
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
You wrote >> Don't read much .NET class documentation, do you?
What you mean by this ?
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
It took me all of 5 seconds to find this answer ... it was pathetically easy to find! Doing research to solve your own problems is a very important skill that you MUST have in this business in order to survive, advance your career, and most importantly, LEARN!
The only reason you didn't find this one was because you didn't even try and find it in the docs for the OpenFileDialog class. Please don't tell me this was your "level best" attempt at solving your own problem.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi,
I won't say it's my level best. But you need to know one painful reality that i am not the founder of any language which we are dealing here(eg. C#).
It may very easy for you. But don't think it is easy for others. This point doesn't mean that you are altimate for all. You can ask yourself that how much you know and how much you need to know.
I politly ask that submitter to show the code.Now i know it is a matter of property.
And next thing is how much i want to cover to fix a problem is purly depend upon me and the depth of a problem.
I never feel hesitation to ask any doubts which is unknown for me.
I don't know what's wrong with you if i ask some code to that queary submitter.
So my word to you is , Dear friend You can critisize me. Provided it must be technical not other.
See for past couple of day's i am trying to figureout one problem. Is it possible for you to help out ? .
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
I haven't found the exact number that is allowed however your best bet right now would be to wrap the call in a try catch block, it is throwing a InvalidOperationException exception.
DialogResult dr;
try
{
dr = open.ShowDialog();
if(dr == DialogResult.OK)
{
string[] files = open.FileNames;
if(files != null)
{
foreach(string file in files)
{
box.Items.Add(file);
}
}
}
}
catch(InvalidOperationException ex)
{
MessageBox.Show(ex.ToString());
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi!
Thanks for the answer!
I've allread done the try, catch thing.
The problem is that i want my program to be able to open more than 200-300(or whatever it is) files.
Is it not possible to open that many files in another way?
Erik
|
|
|
|