|
I am creating an application using c# winform to create and mount ISO files like wincdemu. I am able to create the ISO file and mount it like a local drive. I want to mount the image with disc type CD-ROM/DVD-ROM. I am using AttachVirtualDisk() to mount the image.
Is there any API/library support to mount the image with disc type CD-ROM/CD-R/CD-RW/DVD-ROM/DVD-RAM etc. ?
I appreciate any advice.
|
|
|
|
|
|
How can I reverse strings in other processes in c#? Can this be done with SendMessage or WriteProcessMemory?
|
|
|
|
|
It would have to be WriteProcessMemory. You're going to need admin permissions to do that.
This is akin to writing a debugger. It's not so straight foreword to just read a string, what you THINK is a string anyway, and just write one back. There are a multitude of considerations involved, like PageProtection and race conditions.
No, I'm not going to tell you how to do this because it can be used for malicious purposes.
|
|
|
|
|
Hi guys trying to run a program in c# which needs to return the number of times the char occurs in string. the main is fine but the method name i created gives me an error which i don't know why.(in bold) your help will be appriciated here is my program:
static void Main(string[] args)
{
string n = "Banana";
int num=CountOccurrences(n,'a');
Console.WriteLine(num);
}
static int CountOccurrences(string text, char digit)
{
for (int i=0 ; i < text.Length; i++)
{
if (text[i] == digit)
{
i++;
}
return i;
}
|
|
|
|
|
Your CountOccurrences method has its return statement in the wrong place. Also you are incrementing the loop count in two places so your result will most likely be wrong. It should be:
static int CountOccurrences(string text, char digit)
int count = 0;
for (int i=0 ; i < text.Length; i++)
{
if (text[i] == digit)
{
count++;
}
}
return count;
}
|
|
|
|
|
We don't know what error you are getting, but I suspect it's not the method name that is causing the problem.
Check the error itself - it should give you a good clue as to what is going wrong.
I suspect that the error message is likely to be "not all code paths return a value" - and that means that the compiler can see a route through your code which doesn't execute a return value statement.
Try moving the return i; line outside your for loop, so it's the last instruction in the method!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You prefer a scope error?
|
|
|
|
|
That's his next problem!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
And the fact that he's using the same variable for two different counts. But see my answer ...
|
|
|
|
|
Which starts him off using the debugger to find out what's going on ... with any luck!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
What? I'm awake? Oh damn ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Small sidetrack: You all refer to Joanna as he/him. Is Joanna also used a the name of a male (it certainly is a female name, at least in some parts of the world), or did you just overlook the name of the original poster?
|
|
|
|
|
This is the internet, where men are men, women are men, and 12 year old girls are FBI agents ...
The internet convention is not to assume a gender: male pronouns are generally used unless gender preference is explicitly stated: the OP is from Israel, and I for one have no idea if "Joanna" is a male or female name there (I can't even order a beer in Hebrew, because I've never been there).
Even in English, assuming gender from a name is fraught with difficulties: "Leslie" is generally given to boys, and "Lesley" to baby girls - but sometimes the parents spell the other way round (my wife's father was "Lesley" for example). And some of the "modern names" they give kids these days ... no chance!
And then there is the "I identify sexually as ..." fun and games which throws the whole load in the bin and starts you all over again just for the fun of it. Stick to "he", "him", "his" unless otherwise stated.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Yeah, if you don't know (or are not sure). But I find it difficult to refer to a "Mary" or "Rosalyn" as a "he" in a reply - in situations where I know for sure (at least 99.9%) that the reply goes to a girl. When a poster identifies herself as "Mary", I consider the gender explicitly stated.
The reason why I asked is that "Joanna" as I know it is just as feminine as Mary or Rosalyn. So my question was not primarily about Internet gender conventions, but about this specific name in particular: Is the name Joanna given to boys - in Israel (like the Joanna starting this thread), or in other cultures?
I have argued myself for accepting role designations that for historical reasons are gender specific, as being gender neutral today. E.g. I have no problems accepting male midwives or cleaning ladies. But those are roles, not specific individuals. When I refer to individual persons where the gender is known, I find it strange to refer to the opposite gender. If I were to refer to one specific male midwife, I would never refer to him as "she".
Finish language has a traditional neutral gender reference merging "him" and "her". It is slowly being accepted in Swedish, and I have seen it in Norwegian as well: "hen" as as common term for "han" and "hun". I applaud that development.
Yet, I think it is OK that people call me a "coffee hag" (kaffekjerring) - a dialect expression for a person addicted to coffee. At one national congress, people from the south of Norway refused to believe that we have male hags in mid Norway. I had to get support from others from my district to confirm it. (This was in a discussion whether we should replace the gender specific term "formann" with the gender neutral "leder", where I argued that this is a role description, not a person description.)
|
|
|
|
|
Member 7989122 wrote: "hen" as as common term for "han" and "hun". Try calling a girl "hen" in Glasgow. 
|
|
|
|
|
Ah, an incoming Gorbals Kiss!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
... or a kick in the Gorbals...
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Seen it done once or twice. 
|
|
|
|
|
Richard MacCutchan wrote: Try calling a girl "hen" in Glasgow.
Eh? They wouldn't blink an eye, it's part of the common vernacular.
|
|
|
|
|
Well it was in the days when I was hanging round the docks up there. But these days it is taken as an invitation for a punch in the mouth ... or some softer part of a man's body.
|
|
|
|
|
As a Glaswegian mahsel we'll just have to agree to disagree on that one 
|
|
|
|
|
Interpreting a word from one language in a different language may be fun for entertainment purposes, but that's about all. Except possibly in marketing. When Honda Fitta was to be sold in Scandianvian markets, it was renamed Honda Jazz. "Fitte" means "c**t" in Scandinavian languages.
For a more direct comment: In Norwegian, bird names for girls are certainly not always derogatory. A common term for a sexy young girl is "rype", according to Wikipedia the English name is "lagopus". Not even metooers will come after you for referring to a girl as a "rype". And, isn't "chick" a short form of "chicken"?
It shall be noted that if "hen" were of English origin, and you tried to translate that to Norwegian, to "høne", you should not use that term to refer to a girl: Besides being a bird, it is used as a slang term for the female parts (not the entire girl). So it would be like calling a girl a c**t. While we are at it: Another slang term for the same is "mus" (English: mouse). When you put your hand on that pointing device, you may think we had found another term for it in Norwegian. We did not. So you can imagine what some people jokingly call the scroll wheel.
|
|
|
|
|
In Scotland "hen" is just a slang word for a female, it isn't derogatory (though it is slightly working-class so still frowned on by some) which is why no-one would be offended if you said it.
|
|
|
|