我已经看到 VS2010 公开了 Network Emulator API。我已安装它并尝试使用此 API,但无法检测它是否真的使用此代码运行。有时我给出了错误的配置文件名称,但它不会引发任何错误。请在下面找到我的一段代码。如果有人使用过它,请帮助我。
IntPtr m_emulatorHandle = IntPtr.Zero;
NetworkEmulationApi.LoadProfile(m_emulatorHandle, "300KB_WithLatency.xml");
NetworkEmulationApi.StartEmulation(m_emulatorHandle);