找回密码
 立即注册

QQ登录

只需一步,快速开始

微信扫码登录

搜索
查看: 254|回复: 7

[求助] 求助一个Host.exe

[复制链接]

2

主题

269

回帖

832

积分

四级士官

积分
832
发表于 2025-5-28 03:08:58 | 显示全部楼层 |阅读模式
Hello!
I need a Host.exe that will let me introduce the computer's Ethernet address to the post processor. I would be very happy if you could help me.

Merhaba!
Bilgisayarın Ethernet adresini post işlemciye tanıtmamı sağlayacak bir Host.exe dosyasına ihtiyacım var. Bana yardımcı olabilirseniz çok mutlu olurum.

18

主题

217

回帖

5141

积分

上尉

积分
5141
发表于 2025-5-28 18:45:56 | 显示全部楼层
翻译了一下

using System;
using System.Net;
using System.Net.NetworkInformation;

class EthernetAddressHost
{
    static void Main(string[] args)
    {
        try {
            // 获取第一个活跃的以太网适配器MAC地址
            string macAddress = GetActiveEthernetMAC();
            Console.WriteLine($"Ethernet MAC: {macAddress}");
            
            // 模拟传递给后处理器的逻辑
            PostProcessor.SendToProcessor(macAddress);
            Console.WriteLine("Address transferred to post processor successfully");
        }
        catch (Exception ex) {
            Console.WriteLine($"Error: {ex.Message}");
        }
    }

    static string GetActiveEthernetMAC()
    {
        foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
        {
            if (nic.NetworkInterfaceType == NetworkInterfaceType.Ethernet &&
                nic.OperationalStatus == OperationalStatus.Up)
            {
                return nic.GetPhysicalAddress().ToString();
            }
        }
        throw new Exception("No active Ethernet adapter found");
    }
}

// 后处理器模拟接口
class PostProcessor
{
    public static void SendToProcessor(string macAddress)
    {
        // 实际实现需根据后处理器API调整
        File.WriteAllText("mac_address.txt", macAddress);
    }
}

5

主题

709

回帖

7598

积分

少校

积分
7598
发表于 2025-5-28 11:44:31 | 显示全部楼层
Hoş geldiniz!
Affedersiniz!     I cannot speak Turkish!

10

主题

1093

回帖

1万

积分

中校

积分
11670
发表于 2025-5-28 14:20:31 | 显示全部楼层
来秀英文的吗

0

主题

755

回帖

2150

积分

少尉

积分
2150
发表于 2025-5-28 20:47:01 | 显示全部楼层
你好!
我需要一个 Host.exe,以便将计算机的以太网地址引入后处理器。如果你能帮助我,我会很高兴。

2

主题

269

回帖

832

积分

四级士官

积分
832
 楼主| 发表于 2025-5-29 01:14:07 | 显示全部楼层

我只是想寻求帮助。
你在想什么?

2

主题

269

回帖

832

积分

四级士官

积分
832
 楼主| 发表于 2025-5-29 05:05:31 | 显示全部楼层
比较邮政计算机的 Mac ( ETHERNET ) 地址
如果帖子中没有定义MAC地址,则应取消该帖子。
感谢您的关注和支持。

Post should compare the computer's Mac (ETHERNET) Address If the Mac address is not defined in the post, the post should be cancelled
Thank you for your interest and support.

2

主题

269

回帖

832

积分

四级士官

积分
832
 楼主| 发表于 2025-5-29 05:15:24 | 显示全部楼层
张思颖 发表于 2025-5-28 18:45
翻译了一下

using System;

感谢您的支持。 我无法让它工作。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

咨询QQ:1359218528|发帖须知!|Archiver|手机版|小黑屋|UG爱好者论坛 ( 京ICP备10217105号-2 )

GMT+8, 2025-6-17 01:50

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表