Click here to Skip to main content
15,888,610 members
Home / Discussions / C#
   

C#

 
QuestionWinform taskbar thumbnail problem Pin
Member 1322816728-May-17 21:37
Member 1322816728-May-17 21:37 
QuestionRe: Winform taskbar thumbnail problem Pin
Maciej Los29-May-17 2:31
mveMaciej Los29-May-17 2:31 
AnswerRe: Winform taskbar thumbnail problem Pin
Dave Kreskowiak29-May-17 2:41
mveDave Kreskowiak29-May-17 2:41 
Questioncalling a string variable in "proc.StartInfo.Arguments" Pin
Member 1322808028-May-17 20:02
Member 1322808028-May-17 20:02 
AnswerRe: calling a string variable in "proc.StartInfo.Arguments" Pin
OriginalGriff28-May-17 20:25
mveOriginalGriff28-May-17 20:25 
GeneralRe: calling a string variable in "proc.StartInfo.Arguments" Pin
Member 1322808028-May-17 20:40
Member 1322808028-May-17 20:40 
AnswerRe: calling a string variable in "proc.StartInfo.Arguments" Pin
Ralf Meier28-May-17 21:13
mveRalf Meier28-May-17 21:13 
GeneralRe: calling a string variable in "proc.StartInfo.Arguments" Pin
OriginalGriff28-May-17 21:34
mveOriginalGriff28-May-17 21:34 
And the definition is inside the curly brackets for the main method: which means it's scope is that method, and that method only - it isn't available outside at all.
You could try declaring it outside the method:
private string prnportpatha=@"\\auoa1ws1001\apps\Utilities\AddPrinter\prnport.vbs";
static void Main() 
    {
    Application.Run(new Form1());
    }
private void button1_Click(object sender, System.EventArgs e)
    {
    ....
But it's a bad idea to "hard-code" strings anyway - the actual string you set it to should be in a configuration file that is loaded in your main method so you don't have to recompile your application when it changes (and it will, it will...)
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

GeneralRe: calling a string variable in "proc.StartInfo.Arguments" Pin
Richard MacCutchan28-May-17 21:37
mveRichard MacCutchan28-May-17 21:37 
QuestionDeclaring a Generic Class Pin
Richard Andrew x6428-May-17 14:50
professionalRichard Andrew x6428-May-17 14:50 
AnswerRe: Declaring a Generic Class PinPopular
OriginalGriff28-May-17 19:28
mveOriginalGriff28-May-17 19:28 
GeneralRe: Declaring a Generic Class Pin
Richard Andrew x6429-May-17 2:09
professionalRichard Andrew x6429-May-17 2:09 
GeneralRe: Declaring a Generic Class Pin
OriginalGriff29-May-17 2:26
mveOriginalGriff29-May-17 2:26 
QuestionMessage Closed Pin
28-May-17 9:06
Member 1308759428-May-17 9:06 
AnswerRe: Why still get empty list? Pin
Pete O'Hanlon28-May-17 9:13
mvePete O'Hanlon28-May-17 9:13 
QuestionAbout the WM_LBUTTONDOWN Pin
Member 1322740128-May-17 6:15
Member 1322740128-May-17 6:15 
AnswerRe: About the WM_LBUTTONDOWN Pin
Gerry Schmitz28-May-17 9:51
mveGerry Schmitz28-May-17 9:51 
AnswerRe: About the WM_LBUTTONDOWN Pin
raddevus29-May-17 4:42
mvaraddevus29-May-17 4:42 
QuestionPOST JSON Request to a RESTful service + server deployment Pin
Code_Project_127-May-17 9:07
Code_Project_127-May-17 9:07 
QuestionDislaying 3D model in C# winform Pin
Member 1301708227-May-17 0:11
Member 1301708227-May-17 0:11 
AnswerRe: Dislaying 3D model in C# winform Pin
Dave Kreskowiak27-May-17 4:45
mveDave Kreskowiak27-May-17 4:45 
AnswerRe: Dislaying 3D model in C# winform Pin
lmoelleb28-May-17 2:21
lmoelleb28-May-17 2:21 
GeneralRe: Dislaying 3D model in C# winform Pin
Member 1301708228-May-17 21:45
Member 1301708228-May-17 21:45 
QuestionHow to retrieve image from multiple folder from SharePoint Pin
Hamizah AHMAD TALHAH24-May-17 16:08
Hamizah AHMAD TALHAH24-May-17 16:08 
QuestionRe: How to retrieve image from multiple folder from SharePoint Pin
Richard MacCutchan24-May-17 23:24
mveRichard MacCutchan24-May-17 23:24 

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.