Click here to Skip to main content
14,739,485 members
Home » Discussions » C#
   

C#

 
AnswerRe: Web and Environment Variables Pin
Dave Kreskowiak13-May-20 7:44
mveDave Kreskowiak13-May-20 7:44 
Questioncan any one help me and write this code please Pin
Member 1483029312-May-20 14:52
MemberMember 1483029312-May-20 14:52 
AnswerRe: can any one help me and write this code please Pin
Pete O'Hanlon12-May-20 21:53
mvePete O'Hanlon12-May-20 21:53 
AnswerRe: can any one help me and write this code please Pin
Richard MacCutchan12-May-20 22:35
mveRichard MacCutchan12-May-20 22:35 
AnswerRe: can any one help me and write this code please Pin
Dave Kreskowiak13-May-20 7:42
mveDave Kreskowiak13-May-20 7:42 
AnswerRe: can any one help me and write this code please Pin
#realJSOP15-May-20 2:57
mva#realJSOP15-May-20 2:57 
QuestionMake a simple shape/pattern Pin
M.S.S.E10-May-20 11:36
MemberM.S.S.E10-May-20 11:36 
AnswerRe: Make a simple shape/pattern Pin
Eddy Vluggen10-May-20 11:55
professionalEddy Vluggen10-May-20 11:55 
try
{
	Console.WriteLine("#-#-#-#-#");
	Console.WriteLine(" #-#-#-# ");
	Console.WriteLine("  #-#-#  ");
	Console.WriteLine("   #-#   ");
	Console.WriteLine("    #    ");
	Console.ReadLine();
}
catch (Exception ex)
{
	Console.WriteLine(Convert.ToString(ex));
}
You might be tempted to leave out the spaces at the end of the string, but then the pattern is incomplete. All lines should be of equal length, otherwise there is no symmetry. It also needs exception-handling, so I included that in the example. A simple and naive example, I admit, but it works and the output will be technically correct based on your question.

A more complex variation might be done by counting the amount of #. Each line has one fewer # than the previous one, with the - just being filler until you reach the correct amount of #. I'd image that requires some form of loop, counting, and creating a string based on that count.

M.S.S.E wrote:
thanks in advance.
No problem, glad I could help Thumbs Up | :thumbsup:
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

GeneralRe: Make a simple shape/pattern Pin
M.S.S.E10-May-20 12:42
MemberM.S.S.E10-May-20 12:42 
GeneralRe: Make a simple shape/pattern Pin
Member 798912210-May-20 21:55
MemberMember 798912210-May-20 21:55 
GeneralRe: Make a simple shape/pattern Pin
Pete O'Hanlon10-May-20 22:10
mvePete O'Hanlon10-May-20 22:10 
AnswerRe: Make a simple shape/pattern Pin
Richard MacCutchan10-May-20 22:27
mveRichard MacCutchan10-May-20 22:27 
GeneralRe: Make a simple shape/pattern Pin
M.S.S.E10-May-20 22:37
MemberM.S.S.E10-May-20 22:37 
QuestionRe: Make a simple shape/pattern Pin
Eddy Vluggen11-May-20 3:48
professionalEddy Vluggen11-May-20 3:48 
Questionintegrate IShellFolderViewCB with c#. Pin
Member 125113667-May-20 3:06
MemberMember 125113667-May-20 3:06 
AnswerRe: integrate IShellFolderViewCB with c#. Pin
Richard MacCutchan7-May-20 3:22
mveRichard MacCutchan7-May-20 3:22 
Questioni want to open a form inside a new webbrowser window.i am using javascript fuction Pin
Member 148083135-May-20 18:57
MemberMember 148083135-May-20 18:57 
Rant[REPOST] i want to open a form inside a new webbrowser window.i am using javascript fuction Pin
Richard Deeming6-May-20 1:44
mveRichard Deeming6-May-20 1:44 
QuestionHow can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
arnold_w4-May-20 6:29
Memberarnold_w4-May-20 6:29 
AnswerRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
Richard MacCutchan4-May-20 10:07
mveRichard MacCutchan4-May-20 10:07 
GeneralRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
arnold_w4-May-20 10:13
Memberarnold_w4-May-20 10:13 
GeneralRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
Richard MacCutchan4-May-20 10:16
mveRichard MacCutchan4-May-20 10:16 
GeneralRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
arnold_w4-May-20 10:21
Memberarnold_w4-May-20 10:21 
GeneralRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
Richard MacCutchan4-May-20 10:30
mveRichard MacCutchan4-May-20 10:30 
GeneralRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
Richard Andrew x644-May-20 11:13
professionalRichard Andrew x644-May-20 11:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.