Autor |
Beitrag |
flori112255
Hält's aus hier
Beiträge: 7
|
Verfasst: So 02.01.11 00:28
Hallo Zusammen
ich bin ganz neu in c# und habe ein riesiges problem
und zwar:
C#-Quelltext 1:
| this.webBrowser1.Url = new System.Uri("http://mail.friesi.ch/user/index.php",[b]system[/b].UriKind.Absolute); |
in diesem text kommt bei system folgender fehler: Der Name "system" ist im aktuellen Kontext nicht vorhanden.
dabei hab ich den text nichtmal geschrieben dieser text kam von c# selbst
danke im voraus
Moderiert von Christian S.: I- durch C#-Tags ersetzt
|
|
Kha
      
Beiträge: 3803
Erhaltene Danke: 176
Arch Linux
Python, C, C++ (vim)
|
Verfasst: So 02.01.11 00:49
Für diesen Beitrag haben gedankt: flori112255
|
|
flori112255 
Hält's aus hier
Beiträge: 7
|
Verfasst: So 02.01.11 13:50
|
|
Kha
      
Beiträge: 3803
Erhaltene Danke: 176
Arch Linux
Python, C, C++ (vim)
|
Verfasst: So 02.01.11 13:53
Du darfst natürlich keine eigene Methode namens System haben, das kann nur Ärger geben. Benenne sie um, falls du sie nicht sowieso nur versehentlich angelegt hast.
_________________ >λ=
|
|
flori112255 
Hält's aus hier
Beiträge: 7
|
Verfasst: So 02.01.11 14:13
in was soll ich es sonst umbenennen? hier das bild :
Moderiert von Kha: Bild angehängt
wie gesagt, das hab nicht ich geschrieben, als ich den webbrowser erstellt hab, hat c# das selbst geschrieben
Einloggen, um Attachments anzusehen!
|
|
Kha
      
Beiträge: 3803
Erhaltene Danke: 176
Arch Linux
Python, C, C++ (vim)
|
Verfasst: So 02.01.11 14:32
Du hast irgendwo in der Form1-Klasse eine Methode namens System erstellt, die muss weg. Wo die ist, kann ich dir von hieraus schlecht sagen.
_________________ >λ=
Für diesen Beitrag haben gedankt: flori112255
|
|
flori112255 
Hält's aus hier
Beiträge: 7
|
Verfasst: So 02.01.11 14:58
hier mein text:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98:
| namespace Claudia { partial class Form1 { private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); }
#region Vom Windows Form-Designer generierter Code
private void InitializeComponent() { this.webBrowser1 = new System.Windows.Forms.WebBrowser(); this.button1 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.SuspendLayout(); this.webBrowser1.Location = new System.Drawing.Point(12, 12); this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); this.webBrowser1.Name = "webBrowser1"; this.webBrowser1.Size = new System.Drawing.Size(1492, 549); this.webBrowser1.TabIndex = 0; this.webBrowser1.Url = new System.Uri("http://mail.friesi.ch/user/index.php", system.UriKind.Absolute); this.button1.Location = new System.Drawing.Point(1242, 578); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(128, 83); this.button1.TabIndex = 1; this.button1.Text = "Mail.Gmx.ch"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); this.button3.Location = new System.Drawing.Point(1376, 578); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(128, 83); this.button3.TabIndex = 3; this.button3.Text = "Schliessen"; this.button3.UseVisualStyleBackColor = true; this.button3.Click += new System.EventHandler(this.button3_Click); this.button2.Location = new System.Drawing.Point(1108, 578); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(128, 83); this.button2.TabIndex = 4; this.button2.Text = "Dokumente"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = .System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1516, 673); this.Controls.Add(this.button2); this.Controls.Add(this.button3); this.Controls.Add(this.button1); this.Controls.Add(this.webBrowser1); this.Name = "Form1"; this.Text = "Form1"; this.Load += new System.EventHandler(this.Form1_Load); this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.WebBrowser webBrowser1; private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button3; private System.Windows.Forms.Button button2; } } |
Moderiert von Kha: I- durch C#-Tags ersetzt
|
|
Th69
      

Beiträge: 4798
Erhaltene Danke: 1059
Win10
C#, C++ (VS 2017/19/22)
|
Verfasst: So 02.01.11 16:08
Das ist ja nur der vom VS generierte Code (Form1.designer.cs)?
Der Fehler muß in deinem eigenen Code (Form1.cs) liegen...
|
|
flori112255 
Hält's aus hier
Beiträge: 7
|
Verfasst: So 02.01.11 20:53
alles was ich bisher selbst geschrieben hab ist:
C#-Quelltext 1: 2:
| string url = "http://www.gmx.ch/"; Process.Start(url); |
und
Application.Exit();
hier mein ganzer text
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45:
| 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.Diagnostics;
namespace Claudia { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void button3_Click(object sender, EventArgs e) { Application.Exit(); }
private void button1_Click(object sender, EventArgs e) { string url = "http://www.gmx.ch/"; Process.Start(url); }
private void Form1_Load(object sender, EventArgs e) {
}
private void button2_Click(object sender, EventArgs e) { }
private void System(string p) { throw new NotImplementedException(); } }} |
Moderiert von Christian S.: I- durch C#-Tags ersetzt
|
|
Th69
      

Beiträge: 4798
Erhaltene Danke: 1059
Win10
C#, C++ (VS 2017/19/22)
|
Verfasst: So 02.01.11 21:07
Hallo flori,
bitte benutze die [ cs ] / [ /cs ] - Tags (ohne die Leerzeichen).
Kha hat folgendes geschrieben: |
Du hast irgendwo in der Form1-Klasse eine Methode namens System erstellt, die muss weg.
|
C#-Quelltext 1: 2: 3: 4:
| private void System(string p) { throw new NotImplementedException(); } |
Na, siehst du es?
|
|
flori112255 
Hält's aus hier
Beiträge: 7
|
Verfasst: So 02.01.11 21:30
|
|