|
hi,
basically I am a VB/ASP developer, and I am poor in OOP's concepts. I just started learning C#, and when I am trying to execute my first C# program which i got in one book, after execution it is not returning any line to out put screen. plz help me in this.
CODE:
<br />
using System;<br />
<br />
namespace Wrox.ProCSharp.Basics<br />
{<br />
class MyFirstCSharpClass<br />
{<br />
static void Main()<br />
{<br />
Console.WriteLine("This isn't at all like Java!");<br />
Console.ReadLine();<br />
return;<br />
}<br />
}<br />
}<br />
nagarajuepuri
|
|
|
|
|
Check if you created a console application or a windows application. On project properties, check "Output Type", and set it to "Console Application".
If you set it to "Windows Application", it will have no console and all your Console.WriteLine will be ignored.
Yes, even I am blogging now!
|
|
|
|
|
Thanks for you intrest...
actually, i didn't get you exactly.
I have written this code in a text file and saved it with .CS extension, then i have executed this "sample.cs" file through command line like....
"csc sample.cs"
Here i am not at all creating any application nor project, i am executing all my code through command line only.
thanking you in advance,
nagarajuepuri
|
|
|
|
|
You've only compiled the program, you need to execute it. By default, the executable is placed in the same directory where you compiled it and is named after the source file you compiled. So go to the directory where you compiled and run sample.exe .You'll see the output.
Regards
Senthil
|
|
|
|
|
hi ...
first of all u should add the path of the .Net framework to ur system variables (environment variables -> PATH).
to create an exe file u should ask for this in the command u r using to compile the code sample ... to know the exact syntax of all options u can use with CSC , write "csc /?" (of coursr without the double qoutes).
i hope this helps.
|
|
|
|
|
Thanks you all, I got the solution, once again thanks to you all.
.exe file is created when i compiled the code, then when i executed that, i got the desired output of the program.
but let me clear one thing, can't we get that output at the time of compilation it self???
thanks once again
|
|
|
|
|
Only if you write a batch file to do the compile first, then execute the program. The command line compiler will not launch the finished .EXE for you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Does anyone know how to hide the icon on a windows form?
i have an MDI app and when i call a child form, an icon is displayed in the top left of the child. i dont want this for my child forms because it throws off the main Parent forms toolbar.
any help would be appreciated.
thanks,
.gonad.
|
|
|
|
|
you can change the type of the frame of ur forms to fixedDialog.
i hope this helps
|
|
|
|
|
thanks for the reply but it still shows on the form. when the child form is maximized inside the parent, the icon for the child form shows in the top left of the parent form (directly to the left of the 'file' menu). its the 'control' icon (restore,move,size,min,max,close). there is no way to remove this icon from what ive seen or tried.
thanks,
.gonad
|
|
|
|
|
I am trying to create a card selection screen like the one in Windows Solitaire program in C#. I know how to use the cards.dll and can make the card back draw on the screen but what I am trying to figure out is how to:
1) Make them Clickable objects
2) Make it so that when one is clicked, it is highlighed with a border to indicate it is the one selected.
If anyone can help, it would be appreciated.
Thanks.
|
|
|
|
|
Ok, I know there is File.Exists and there are ways to pull out comments from the FileInfo but is there a way in C# .NET to find out if a certain file is signed with a security certificate or not?
|
|
|
|
|
fast way to find the index of the first letter in a richTextBox?
|
|
|
|
|
A regular expression.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
How???(Do you know?) I need the position of the letter
|
|
|
|
|
Yes, you need the position of the letter, we understood this in your first posting.
But unless you're telling us exactly what you want we'll have to guess what you mean.
If you want the location of the first character in a RichTextBox on your screen your should use RichTextBox.GetPositionFromCharIndex() .
mav
|
|
|
|
|
mav.northwind, I'm sorry.
My English is not good. I mean the index is what I want.
|
|
|
|
|
Hello,
I have a ToolBar in my MDI child form. My toolbar buttons are set to display text to the right of the image.
My problem is that all the buttons are sized equal, and I wish each to have a different size, depending on the length of the text. The button size is 22 x 22, which is about enough for a 16 x 16 image with no text. One would think about the AutoSize property, but it relates to the toolbar and not the buttons.
Any ideas? Thanks!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Create your own derived toolbar item class ( I forget the class name ) and then you can set the item size to be whatever you want.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
ToolBarButton .
I was looking at the ToolBarButton docs, and I didn't find any property, public or protected that I could override. Any pointers?
Thanks,
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
In a very large richTextBox I want to find all letters.
Is there something faster than :
char[] letters={ 'a','b','c','d','e','f','g','h','i', 'j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S',<br />
'T','U','V','W','X','Y','Z'} ;<br />
richTextBox1.Text.IndexOfAny(letters, i);
OR
richTextBox1.Text[i].IsLetter;
|
|
|
|
|
I'm not sure how much faster it'd be, but have you looked at System.Text.RegularExpressions?
Optionally, you could check the text each time a new character is entered to see if it's a letter, then just set some boolean flag indicating whether all characters are letters.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
I doubt you could make it slower....
Use RegEx, or IsChar on each character as they are typed, as has been suggested.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I want to make blue color all words
int position=0;<br />
char[] KeywordsCanStartWith = {'_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',<br />
'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I',<br />
'J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'} ;<br />
char[] KeywordsEndBeforeApears = {' ','\t','(',')',',','.',';','\n','[',']','{','}','+','-','*','/',':',<br />
'=','<','>','|','\\','&','%','?','$','!','"','#','\'','@','^'} ;<br />
bool LogVar;<br />
void giveColorToKeywordsInRTB(object sender, System.EventArgs e)<br />
{<br />
position=0;<br />
KeywordStartsHere=-1; caretPos=richTextBox1.SelectionStart; <br />
LogVar=true;<br />
LockWindowUpdate(richTextBox1.Handle);<br />
richTextBox1.Select(0, richTextBox1.Text.Length);<br />
richTextBox1.SelectionColor = Color.Black ;<br />
while(LogVar)<br />
{<br />
KeywordStartsHere = richTextBox1.Text.IndexOfAny(KeywordsCanStartWith , position);<br />
if(position<0)<br />
break ; <br />
if(position==KeywordStartsHere)<br />
{<br />
position = richTextBox1.Text.IndexOfAny(KeywordsEndBeforeApears, position) ;<br />
if(position==-1)<br />
position=richTextBox1.Text.Length-1 ;<br />
else<br />
position--;<br />
richTextBox1.Select(KeywordStartsHere, position-KeywordStartsHere+1);<br />
richTextBox1.SelectionColor = Color.Blue ;<br />
}<br />
}<br />
if(++position > richTextBox1.Text.Length-1)<br />
LogVar=false;<br />
}<br />
}
|
|
|
|
|
Judah Himango and Christian It is a source code editor that makes use of
/*, */, //, "" to make some pieces green etc. So I must jumb from point to point.
That's why I prefer to use .IndexOf instead of .IsLetter.
Could you give me an idea of how to use the solution you suggest(with a litle piece of code if it is possible?)
|
|
|
|
|