场景,手持设备设置功率大小,临时存在XML里,理论上应该写在数据库中,通过服务端读取返回客户端,实现一设备设置功率,同步更新所有智能硬件设备功率,
1 private static void SetPorwer(string value) 2 { 3 try 4 { 5 string strText = @" 6 <DataList> 7 <Data>" + value + @"</Data> 8 </DataList> 9 "; 10 System.IO.StreamWriter sw = new System.IO.StreamWriter(path, false, System.Text.Encoding.Default); 11 sw.WriteLine(strText); 12 sw.Close(); 13 } 14 catch (Exception) 15 { } 16 }