I am writing a c# program, which is used for generating an HTML file and calls a JavaScript function when a button is clicked in the WPF project. However, when I use the function, it throws an error.
Error message: A using namespace directive can only be applied to namespaces; 'System.Object' is a type not a namespace
Part of my code:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using System.IO; using System.Windows.Forms; using System.Object; namespace HTMLtesting { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); createHTMLPage(); } private void stopButton_Click(object sender, RoutedEventArgs e) { webBrowser1.Document.InvokeScript("stopPlaying"); }