Posts
土豆視頻開發系列-依影集分類查詢
XmlNodeList nodes = xmlDom.SelectNodes(@"/result/results/AlbumInfo"); foreach (XmlNode node in nodes) { // Name = node.ChildNodes[1].InnerText // picUrl = node.ChildNodes[2].InnerText // … … } … }
read morePosts
[C#]取得檔案內容中的詳細資料
using System.Linq;
using System.Text;
using Shell32;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
ViewDetailColumn();
Console.WriteLine(new string(’=’, 50));
var file = @“C:\Users\Public\Music\Sample Music\Kalimba.mp3”;
ViewDetailValue(file, “Album”);
ViewDetailValue(file, “Size”);
}
static IEnumerable<KeyValuePair<string, int>> GetDetailColumn()
{
ShellClass sh = new ShellClass();
Folder dir = sh.NameSpace(@“c:");
int idx = 0;
string columnName = dir.GetDetailsOf(0, idx);
do
{
yield return new KeyValuePair<string, int>(columnName, idx);
columnName = dir.GetDetailsOf(0, ++idx); } while (!
read morePosts
[C#]原子能委員會輻射監控非官方API
namespace LevelUp.RadiationAPI.Demo { public partial class Form1 : Form { private RadiationAgent _radiationAgent; private RadiationAgent m_RadiationAgent { get { if (_radiationAgent == null) { _radiationAgent = new RadiationAgent(); _radiationAgent.AutoUpdateInterval = 5000; _radiationAgent.EnableAutoUpdate = true; } return _radiationAgent; } }
public Form1() { InitializeComponent(); } private void UpdateRadiationValue() { listView1.Items.Clear(); listView1.BeginUpdate(); foreach (var data in m_RadiationAgent.RadiationDatas) { listView1.Items.Add(data.City).SubItems.AddRange(new string[] { data.RadiationValue.ToString(), data.State.ToString() }); } listView1.EndUpdate(); } private void timer1_Tick(object sender, EventArgs e) { UpdateRadiationValue(); } private void Form1_Load(object sender, EventArgs e) { UpdateRadiationValue(); m_RadiationAgent.
read more