我放了一个声音文件到资源中去,我用的时候要写它的地址,即 string 类型的地址,请问应该怎么写啊?谢谢

解决方案 »

  1.   

    global::<命名空间>.Properties.Resources.资源名以上要把<命名空间>替换成你的资源所在的命名空间;
    资源名就不用说了,写了前面的代码再加一点就出来所有了资源名了
      

  2.   

    Sound.PlaySoundCS.Play(string 路径 );我要播放的是这个文件  Properties .Resources .move;
      

  3.   

    错误 3 参数“1”: 无法从“System.IO.UnmanagedMemoryStream”转换为“string” D
      

  4.   

    请问怎么把它转为 string 形式啊?谢谢
      

  5.   

    Sound.PlaySoundCS.Play(global:: <命名空间>.Properties.Resources.资源名 .tostring() );试下?? 
      

  6.   

    晕死~~这都能ToString()呢。。byte[] _ResourcesBytes =(byte[])<命名空间>.Properties.Resources.资源名;  System.IO.FileStream _ResourcesFileStream = new System.IO.FileStream(Application.StartupPath + "\\Temp.Dat", System.IO.FileMode.Create);
          
                _ResourcesFileStream.Write(_ResourcesBytes , 0, _ResourcesBytes .Length);
                _ResourcesFileStream.Close();            Sound.PlaySoundCS.Play(Application.StartupPath + "\\Temp.Dat");
      

  7.   

    直接用Stream不好吗?如果程序写得好也不用改多少东西,只要重载一方法就好了