wie ktoś dlaczego nie działa mi wininetDll?

**Załączone nagłówki:**
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.Net.NetworkInformation;

**Zmienne**
#region Zmienne
        [System.Runtime.InteropServices.DllImport("wininet.dll")]
        private extern static bool InternetGetConnectedState(out int Description, int ReservedValue);

        static bool internet_connection()
        {
            int desc;
            return InternetGetConnectedState(out desc, 0);
        }
        #endregion Zmienne
**I button sprawdzający połączenie z internetem przed uruchomieniem kolejnego okna:**
 private void wininetDll_btn_Click(object sender, EventArgs e)
        {
            wininetdll_cb.Checked = internet_connection();   **wywala: the "wininetDll" does not exist in the current conext **
            if (wininetDll_cb.Checked)
            {
                Kurs kurs = new Kurs();
                kurs.Show();

            }
            else
            {
                ConnectionError error2 = new ConnectionError();
                error2.Show();

            }
        }