Я принимаю ОС NAS с Cosmos и Oracle VirtualBox с VS 2022 C#. Но, к сожалению, каким -то образом он не получает IP -адрес с мобильной точкой доступа тем временем работает через Wi -Fi из дома. В настройках сети я использую мосточный адаптер с типом адаптера Intel Pro /1000 MT (82540EM).using Cosmos.System.Network.Config;
using Cosmos.System.Network.IPv4;
using Cosmos.System.Network.IPv4.UDP.DHCP;
// using CosmosFtpServer;
using CosmosTest.App.HttpServer;
using System;
using System.Threading;
namespace CosmosTest.App
{
internal class Application
{
private Network network;
public Application(Network network)
{
this.network = network;
Console.WriteLine("Application: Constructor started.");
Console.WriteLine("Application: Starting DHCP...");
Console.WriteLine("Application: DHCP process finished. IP acquired.");
Console.WriteLine("Application: Initializing TcpServer (HTTP)...");
new TcpServer(80);
Console.WriteLine("Application: Initializing FtpServer...");
new FtpServer();
Console.WriteLine("Application: All servers initialized.");
}
}
}
< /code>
И это мой kernel.cs: < /p>
using CosmosTest.App;
using System;
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using Sys = Cosmos.System;
namespace CosmosTest
{
public class Kernel : Sys.Kernel
{
private Network network = null!;
protected override void BeforeRun()
{
Console.Clear();
Console.WriteLine("\r\n\r\n ________ ________ ________ \r\n|\\ ___ \\|\\ __ \\|\\ ____\\ \r\n\\ \\ \\\\ \\ \\ \\ \\|\\ \\ \\ \\___|_ \r\n \\ \\ \\\\ \\ \\ \\ __ \\ \\_____ \\ \r\n \\ \\ \\\\ \\ \\ \\ \\ \\ \\|____|\\ \\ \r\n \\ \\__\\\\ \\__\\ \\__\\ \\__\\____\\_\\ \\ \r\n \\|__| \\|__|\\|__|\\|__|\\_________\\\r\n \\|_________|\r\n\r\n");
network = new Network();
if(!network.Initialize())
{
Console.WriteLine("Press any key to restart");
Console.ReadKey();
Sys.Power.Reboot();
}
}
protected override void Run()
{
try
{
new Application(network);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Sys.Power.Reboot();
}
string input = Console.ReadLine();
if(input == "x")
{
Sys.Power.Shutdown();
}
}
}
}
< /code>
И это моя network.cs: < /p>
using Cosmos.System.Network.Config;
using Cosmos.System.Network.IPv4.UDP.DHCP;
using System;
using System.Threading;
namespace CosmosTest.App
{
internal class Network
{
internal Network()
{
}
internal bool Initialize()
{
int attempts = 0;
Console.Write("Network Initializing");
using (var xClient = new DHCPClient())
{
while (attempts < 5)
{
if(xClient.SendDiscoverPacket()>=0)
{
Console.WriteLine("done");
Console.WriteLine("IP-Address: "+NetworkConfiguration.CurrentAddress.ToString());
return true;
}
Thread.Sleep(1000);
Console.Write(".");
attempts++;
}
}
Console.WriteLine("failed");
return false;
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... le-hotspot
VirtualBox Hosted Cosmos не получает IP с мобильной точкой доступа ⇐ C#
Место общения программистов C#
-
Anonymous
1749747726
Anonymous
Я принимаю ОС NAS с Cosmos и Oracle VirtualBox с VS 2022 C#. Но, к сожалению, каким -то образом он не получает IP -адрес с мобильной точкой доступа тем временем работает через Wi -Fi из дома. В настройках сети я использую мосточный адаптер с типом адаптера Intel Pro /1000 MT (82540EM).using Cosmos.System.Network.Config;
using Cosmos.System.Network.IPv4;
using Cosmos.System.Network.IPv4.UDP.DHCP;
// using CosmosFtpServer;
using CosmosTest.App.HttpServer;
using System;
using System.Threading;
namespace CosmosTest.App
{
internal class Application
{
private Network network;
public Application(Network network)
{
this.network = network;
Console.WriteLine("Application: Constructor started.");
Console.WriteLine("Application: Starting DHCP...");
Console.WriteLine("Application: DHCP process finished. IP acquired.");
Console.WriteLine("Application: Initializing TcpServer (HTTP)...");
new TcpServer(80);
Console.WriteLine("Application: Initializing FtpServer...");
new FtpServer();
Console.WriteLine("Application: All servers initialized.");
}
}
}
< /code>
И это мой kernel.cs: < /p>
using CosmosTest.App;
using System;
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using Sys = Cosmos.System;
namespace CosmosTest
{
public class Kernel : Sys.Kernel
{
private Network network = null!;
protected override void BeforeRun()
{
Console.Clear();
Console.WriteLine("\r\n\r\n ________ ________ ________ \r\n|\\ ___ \\|\\ __ \\|\\ ____\\ \r\n\\ \\ \\\\ \\ \\ \\ \\|\\ \\ \\ \\___|_ \r\n \\ \\ \\\\ \\ \\ \\ __ \\ \\_____ \\ \r\n \\ \\ \\\\ \\ \\ \\ \\ \\ \\|____|\\ \\ \r\n \\ \\__\\\\ \\__\\ \\__\\ \\__\\____\\_\\ \\ \r\n \\|__| \\|__|\\|__|\\|__|\\_________\\\r\n \\|_________|\r\n\r\n");
network = new Network();
if(!network.Initialize())
{
Console.WriteLine("Press any key to restart");
Console.ReadKey();
Sys.Power.Reboot();
}
}
protected override void Run()
{
try
{
new Application(network);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Sys.Power.Reboot();
}
string input = Console.ReadLine();
if(input == "x")
{
Sys.Power.Shutdown();
}
}
}
}
< /code>
И это моя network.cs: < /p>
using Cosmos.System.Network.Config;
using Cosmos.System.Network.IPv4.UDP.DHCP;
using System;
using System.Threading;
namespace CosmosTest.App
{
internal class Network
{
internal Network()
{
}
internal bool Initialize()
{
int attempts = 0;
Console.Write("Network Initializing");
using (var xClient = new DHCPClient())
{
while (attempts < 5)
{
if(xClient.SendDiscoverPacket()>=0)
{
Console.WriteLine("done");
Console.WriteLine("IP-Address: "+NetworkConfiguration.CurrentAddress.ToString());
return true;
}
Thread.Sleep(1000);
Console.Write(".");
attempts++;
}
}
Console.WriteLine("failed");
return false;
}
}
}
Подробнее здесь: [url]https://stackoverflow.com/questions/79663516/virtualbox-hosted-cosmos-does-not-get-ip-with-mobile-hotspot[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия