C# Error Cs1518 Expected Class Delegate Enum Interface Or Struct
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of error 1 expected class delegate enum interface or struct c# this site About Us Learn more about Stack Overflow the company Business expected class delegate enum interface or struct void Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask expected class delegate enum interface or struct c# Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up expected class delegate enum interface or struct in mvc Error CS1518: Expected class, delegate, enum, interface, or struct up vote 0 down vote favorite In my c# program I have this first line: using System; using System.Diagnostics; using System.ComponentModel; private const string TargetUrl = "http://www.TEST.com"; private const string TorAppLocation = @"C:\Program Files (x86)\test\Lis\lis.exe"; private static readonly string[] InstalledBrowsers = new[]{"IExplore","Chrome","Firefox","Safari"}; static private Process _prc; static private int _reqCounter = 0; ... When
How To Solve Expected Class Delegate Enum Interface Or Struct
I compile it returns error CS1518: Expected class, delegate, enum, interface, or struct. How can I solve it? c# share|improve this question edited Jun 30 '14 at 12:30 DIF 1,75221736 asked Jun 30 '14 at 12:17 almal 3871725 it says it wants a class, delegate, enum interface or struct; that is a big hint, because fields etc must be defined inside a class or struct –Marc Gravell♦ Jun 30 '14 at 12:19 The only meaningful answer to this question would be a complete tutorial explaining how OOP and C# works, making it too broad –Alex Jun 30 '14 at 12:31 add a comment| 2 Answers 2 active oldest votes up vote 3 down vote accepted Please define your const and member field inside your class class Program { private const string TargetUrl = "http://www.TEST.com"; private const string TorAppLocation = @"C:\Program File (x86)\test\Lis\lis.exe"; private static readonly string[] InstalledBrowsers = new[]{"IExplore","Chrome","Firefox","Safari"}; static private Process _prc; static private int _reqCounter = 0; static void Main(string[] args) { //code here } } share|improve this answer answered Jun 30 '14 at 12:25 Moez Rebai 2,8781926 add a comm
here for a quick overview of the site Help
Error 1 Type Or Namespace Definition Or End Of File Expected
Center Detailed answers to any questions you might have cs1518 error Meta Discuss the workings and policies of this site About Us Learn more about Stack identifier expected c# Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask http://stackoverflow.com/questions/24489985/error-cs1518-expected-class-delegate-enum-interface-or-struct Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Errors when compiling: “Expected class, delegate, enum, interface, or struct” up vote 2 down vote http://stackoverflow.com/questions/16800130/errors-when-compiling-expected-class-delegate-enum-interface-or-struct favorite What is wrong with this code? This program is meant to copy a file and email it to a email address, but it doesn't. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Net; using System.Net.Mail; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { } } public void email_send() { MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com"); mail.From = new MailAddress("your mail@gmail.com"); mail.To.Add("to_mail@gmail.com"); mail.Subject = "Test Mail - 1"; mail.Body = "mail with attachment"; System.Net.Mail.Attachment attachment; attachment = new System.Net.Mail.Attachment("c:/textfile.txt"); mail.Attachments.Add(attachment); SmtpServer.Port = 587; SmtpServer.Credentials = new System.Net.NetworkCredential("your mail@gmail.com", "your password"); SmtpServer.EnableSsl = true; SmtpServer.Send(mail); } } This shows the following compiler errors: Expected class, de
ASP.NET Community Standup Forums Help Home/ASP.NET Forums/.NET Languages/C#/CS1518: Expected class, delegate, enum, interface, or struct CS1518: Expected class, delegate, enum, interface, or struct RSS 2 http://forums.asp.net/t/1045063.aspx?CS1518+Expected+class+delegate+enum+interface+or+struct replies Last post Nov 15, 2006 04:16 AM by Callan ‹ Previous Thread|Next Thread › Print Share Twitter Facebook Email Shortcuts Active Threads Unanswered Threads Unresolved Threads Support Options http://forums.terraria.org/index.php?threads/i-need-help-with-tmodloader.41074/ Advanced Search Reply Callan None 0 Points 2 Posts CS1518: Expected class, delegate, enum, interface, or struct Nov 14, 2006 09:20 AM|Callan|LINK Any help with this would be GREATLY appreciated. expected class I am unfortunately new to C# andhave beenself-tutoring,I do however know VB. The problem is I have been given a site that was written by someone else. I am getting the following error: Source Error: Line 275: public test_aspx() { Line 276: string[] dependencies; Line 277: ((System.Web.UI.testControls.testPage)(this)).AppRelativeVirtualPath = "~/test.aspx"; It is from the following temp file that I am expected class delegate assuming the server has written: Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c48e1275\9f3e96b7\App_Web_test.aspx.cdcab7d2.6zyjs6vu.0.cs Line: 275 I have checked through all the .cs files that were used to compile the .dll file that sits in the bin folder, however, I cannot find that line anywhere. As I said, ANY suggestions or references that could possibly help would be greatly appreciated Reply Caddre Contributor 4150 Points 5259 Posts Re: CS1518: Expected class, delegate, enum, interface, or struct Nov 14, 2006 11:51 AM|Caddre|LINK I found two that will help but the first should resolve your problem. Hope this helps. http://blogs.msdn.com/jomo_fisher/archive/2004/10/01/236879.aspx http://www.csharphelp.com/archives/archive273.html Kind regards, Gift Peddie Reply Callan None 0 Points 2 Posts Re: CS1518: Expected class, delegate, enum, interface, or struct Nov 15, 2006 04:16 AM|Callan|LINK Thank you for the response. I had left out a "}". ‹ Previous Thread|Next Thread › This site is managed for Microsoft by Neudesic, LLC. | © 2016 Microsoft. All rights reserved. Privacy Statement| Terms of Use| Contact Us| Advertise With Us| CMS by Umbraco| Hosted on Microsoft Azure Feedback on ASP.NET| File Bugs| Support Lifecycle
in 'General Mod Discussion' started by Vyrvin, Mar 2, 2016. Terraria Community Forums Home Forums > Terraria on PC > Player-Created Game Enhancements > Client/Server Mods & Tools > General Mod Discussion > ? How you would rate your C# Coding Skills? Poll closed Mar 3, 2016. 100% 0 vote(s) 0.0% 90% 0 vote(s) 0.0% 80% 0 vote(s) 0.0% 70% 0 vote(s) 0.0% 60% 0 vote(s) 0.0% 50% 0 vote(s) 0.0% 40% 0 vote(s) 0.0% 30% 0 vote(s) 0.0% 20% 0 vote(s) 0.0% 15% 1 vote(s) 100.0% 10% 0 vote(s) 0.0% 5% 0 vote(s) 0.0% 0% 0 vote(s) 0.0% Thread Status: Not open for further replies. Thread was lock by: Tunnel King Reason: author no longer around. Lock date: 19:16 16-06-2016 Thread Tools Thread Tools Vyrvin Terrarian i dont need help anymore, i got c# knowledge. Last edited: Mar 3, 2016 Vyrvin, Mar 2, 2016 #1 Eldrazi Eater of Worlds Vyrvin said: ↑ Hey guys as you know i plan to make a vyrvin's ultimate modpack. I don't know really to code c#. If anyone would be nice and found solution/video tutorials or did a tutorials for me a would learn me c# then i would like to add you to special thanks list and to Vyrvin's Ultimate modpack team. If someone is expert on coding c#. Please help me find solution or video tutorials or teach c#. If someone would be that kind then i would really appreaciate that.Click to expand... Well, I guess no one would call themselves an expert (or claim to have 100% C# coding skills at that), since there's always more to learn (if you DO think of yourself as an expert and are reading this, I don't mean to offend you, you're an exception (on these forums )). Anyways, a good place to start would be learning the syntax of C# (so you don't make 'beginner' errors like forgetting to put a closing bracket, that kind of stuff). Other than that, you can always search for beginner C# tutorials online. I've watched t