none
怎么样能获取teredo通道的ipv6地址? RRS feed

  • 问题

  • 大家好,

    参考了小歐ou的例程,能正确获取物理的ipv6地址。可无法获取虚拟的teredo通道的ipv6地址,该如何解决?

    多谢!


    2011年8月11日 1:34

答案

  • Hi buhuang,

     

    你好!我们可以在命令行中(开始->运行->cmd)运行以下命令,显示获取Teredo IPv6信息。 

    netsh interface ipv6 show teredo

     

    如果需要写C#程序来获取该信息的话,请看下列代码和截图,一目了然。

    拖放button1 richTextBox1form1.

            private void button1_Click(object sender, EventArgs e)

            {

                // Run command line and output to Text file 

                System.Diagnostics.Process.Start(@"Cmd.exe", @"/C netsh interface ipv6 show teredo > D:\result.txt");

                //  Just an example

                //  /C parameter means exiting Cmd.exe after executing command 

              

                // Delay 2 seconds to wait for above command to execute completely 

                System.Threading.Thread.Sleep(2000);

                

                // Retrieve the text file content and show in RichTextBox 

                if (System.IO.File.Exists(@"D:\result.txt"))

                {

                   string content =System.IO.File.ReadAllText(@"D:\result.txt");

                   richTextBox1.Text = content;

                }

            }


     


    Martin Xie [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • 已标记为答案 buhuang 2011年8月12日 10:23
    2011年8月12日 9:54
    版主

全部回复

  • Hi buhuang,

     

    你好!我们可以在命令行中(开始->运行->cmd)运行以下命令,显示获取Teredo IPv6信息。 

    netsh interface ipv6 show teredo

     

    如果需要写C#程序来获取该信息的话,请看下列代码和截图,一目了然。

    拖放button1 richTextBox1form1.

            private void button1_Click(object sender, EventArgs e)

            {

                // Run command line and output to Text file 

                System.Diagnostics.Process.Start(@"Cmd.exe", @"/C netsh interface ipv6 show teredo > D:\result.txt");

                //  Just an example

                //  /C parameter means exiting Cmd.exe after executing command 

              

                // Delay 2 seconds to wait for above command to execute completely 

                System.Threading.Thread.Sleep(2000);

                

                // Retrieve the text file content and show in RichTextBox 

                if (System.IO.File.Exists(@"D:\result.txt"))

                {

                   string content =System.IO.File.ReadAllText(@"D:\result.txt");

                   richTextBox1.Text = content;

                }

            }


     


    Martin Xie [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • 已标记为答案 buhuang 2011年8月12日 10:23
    2011年8月12日 9:54
    版主
  • Hi buhuang,

     

    你好!我们可以在命令行中(开始->运行->cmd)运行以下命令,显示获取Teredo IPv6信息。 

    netsh interface ipv6 show teredo

     

    如果需要写C#程序来获取该信息的话,请看下列代码和截图,一目了然。

    拖放button1 richTextBox1form1.

            private void button1_Click(object sender, EventArgs e)

            {

                // Run command line and output to Text file 

                System.Diagnostics.Process.Start(@"Cmd.exe", @"/C netsh interface ipv6 show teredo > D:\result.txt");

                //  Just an example

                //  /C parameter means exiting Cmd.exe after executing command 

              

                // Delay 2 seconds to wait for above command to execute completely 

                System.Threading.Thread.Sleep(2000);

                

                // Retrieve the text file content and show in RichTextBox 

                if (System.IO.File.Exists(@"D:\result.txt"))

                {

                   string content =System.IO.File.ReadAllText(@"D:\result.txt");

                   richTextBox1.Text = content;

                }

            }


     


    Martin Xie [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Martin Xie你好!还特意写的例程,真的是十分感谢!!!

    这方法不错,真是变则通啊。

    另外再请教个问题,对g723.1语音编解吗有研究么?望赐教。


    2011年8月12日 10:27
  • 谢谢你的反馈,很高兴听到你的问题解决了。

    关于g723.1语音编解码的问题,我没研究过,很抱歉不能帮到你,你可前往相关产品论坛去咨询。

    欢迎再来!


    Martin Xie [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    2011年8月15日 3:34
    版主