[問題] 自架Web Server及HTML內容更新請益

作者: james999 (無傷大雅)   2018-01-15 15:34:02
目前是使用Windows Iot Core架設Web Server,
主要是參考https://goo.gl/dQD5Lw
html內有些資訊內容在頁面呈現前就要先填入,
目前是採用原作者的教學,再將從其他地方讀到的內容填入input text內,
類似下方這樣..
var html = Encoding.UTF8.GetBytes($"<html><head><title>Background Message
</title></head><body>Hello from the background process!<br/>{query}</body>
</html>");
其中,{query}是C#變數值。
然後頁面的input text內就都不會是空白的,且有數值..
不曉得有沒有其他比較好的方法呢? 謝謝。
作者: ssccg (23)   2018-01-15 15:39:00
你可以把html檔案讀進來,replace裡面你要換掉的字串

Links booklink

Contact Us: admin [ a t ] ucptt.com