ravaei
یک شنبه 07 دی 1393, 15:46 عصر
درود . اول error رو متنشو می زارم احساس می کنم به خاطر کم تجربگیه تاحالا با این حالت روبرو نشدم.
A first chance exception of type 'System.NotImplementedException' occurred in WindowsFormsApplication23.exe
Additional information: The method or operation is not implemented.
If there is a handler for this exception, the program may be safely continued.
یه کلاس نوشتم که کدشو پایین میزارم هروقت به نحوی از این کلاس استفاده می کنم برنامه break میشه و پیغام بالا رو میده که دو گزینه break و countinue رو داره .
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Management.Instrumentation;
namespace WindowsFormsApplication23
{
class connecting
{
public bool connectioninfo()
{
bool cnt=false;
ManagementObjectSearcher deviceList = new ManagementObjectSearcher("Select Name, Status from Win32_PnPEntity");
foreach (ManagementObject device in deviceList.Get())
{
string name = device.GetPropertyValue("Name").ToString();
if (name == "Apple Mobile Device USB Driver" || name == "SAMSUNG Mobile USB Composite Device")
{
cnt = true;
}
}
if (cnt == true) return true;
else return false;
}
}
}
در آخر هم وقتی Break رو میزنم به این کد گیر میده .
throw new NotImplementedException();
A first chance exception of type 'System.NotImplementedException' occurred in WindowsFormsApplication23.exe
Additional information: The method or operation is not implemented.
If there is a handler for this exception, the program may be safely continued.
یه کلاس نوشتم که کدشو پایین میزارم هروقت به نحوی از این کلاس استفاده می کنم برنامه break میشه و پیغام بالا رو میده که دو گزینه break و countinue رو داره .
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Management.Instrumentation;
namespace WindowsFormsApplication23
{
class connecting
{
public bool connectioninfo()
{
bool cnt=false;
ManagementObjectSearcher deviceList = new ManagementObjectSearcher("Select Name, Status from Win32_PnPEntity");
foreach (ManagementObject device in deviceList.Get())
{
string name = device.GetPropertyValue("Name").ToString();
if (name == "Apple Mobile Device USB Driver" || name == "SAMSUNG Mobile USB Composite Device")
{
cnt = true;
}
}
if (cnt == true) return true;
else return false;
}
}
}
در آخر هم وقتی Break رو میزنم به این کد گیر میده .
throw new NotImplementedException();