| happy's profile快快乐乐PhotosBlogLists | Help |
|
November 06 心理话我真的好爱你,好喜欢你,在看到你我一瞬间,你可能没有查觉,你可能不会明白,只不过我对爱的这种表达方式不风而已,很难想像你对我的看法,我真迷惘,很失落,不知应该何去何从!!!如果生命里再有一次遇见你,我会对你说三个“我爱你”,一生一世,如果上天还会给我一次机会的话,我还会选择你。也许,你觉得我这个太现实,太古板,也不浪漫,没有什么情趣,经常让你处天一种无言沉默的状态,你经常因为一点小事和我挣吵,恼情绪。唉,累呀,烦呀,郁闷呀。 March 10 0000---- WinForm.cs using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Runtime.InteropServices; // for PlaySound() using Microsoft.Win32; // RegistryKey namespace PlaySound { /// <summary> /// Summary description for WinForm. /// </summary> public class WinForm : System.Windows.Forms.Form { private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox tbFileName; private System.Windows.Forms.Button buttonPlay; private System.Windows.Forms.ComboBox cbUserSound; private System.Windows.Forms.Button buttonBrowse; private System.Windows.Forms.Label label2; private RegistryKey key1; private RegistryKey key2; private PropertyCollection events; // PlaySound() [DllImport("winmm.dll", SetLastError=true, CallingConvention=CallingConvention.Winapi)] static extern bool PlaySound( string pszSound, IntPtr hMod, SoundFlags sf ); [Flags] public enum SoundFlags : int { SND_SYNC = 0x0000, /* play synchronously (default) */ SND_ASYNC = 0x0001, /* play asynchronously */ SND_NODEFAULT = 0x0002, /* silence (!default) if sound not found */ SND_MEMORY = 0x0004, /* pszSound points to a memory file */ SND_LOOP = 0x0008, /* loop the sound until next sndPlaySound */ SND_NOSTOP = 0x0010, /* don't stop any currently playing sound */ SND_NOWAIT = 0x00002000, /* don't wait if the driver is busy */ SND_ALIAS = 0x00010000, /* name is a registry alias */ SND_ALIAS_ID = 0x00110000, /* alias is a predefined ID */ SND_FILENAME = 0x00020000, /* name is file name */ SND_RESOURCE = 0x00040004 /* name is resource name or atom */ } /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.Container components = null; public WinForm() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // // Populate combobox with sounds // from the registry PopulateDropDown(); } /// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose (bool disposing) { if (disposing) { if (components != null) { components.Dispose(); } } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.label1 = new System.Windows.Forms.Label(); this.tbFileName = new System.Windows.Forms.TextBox(); this.buttonPlay = new System.Windows.Forms.Button(); this.buttonBrowse = new System.Windows.Forms.Button(); this.cbUserSound = new System.Windows.Forms.ComboBox(); this.label2 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // label1 // this.label1.Location = new System.Drawing.Point(16, 16); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(80, 23); this.label1.TabIndex = 0; this.label1.Text = "Sound File:"; // // tbFileName // this.tbFileName.Location = new System.Drawing.Point(96, 16); this.tbFileName.Name = "tbFileName"; this.tbFileName.Size = new System.Drawing.Size(216, 20); this.tbFileName.TabIndex = 1; this.tbFileName.Text = ""; this.tbFileName.TextChanged += new System.EventHandler(this.tbFileName_TextChanged); // // buttonPlay // this.buttonPlay.Enabled = false; this.buttonPlay.Location = new System.Drawing.Point(280, 48); this.buttonPlay.Name = "buttonPlay"; this.buttonPlay.TabIndex = 2; this.buttonPlay.Text = "&Play"; this.buttonPlay.Click += new System.EventHandler(this.buttonPlay_Click); // // buttonBrowse // this.buttonBrowse.Location = new System.Drawing.Point(328, 16); this.buttonBrowse.Name = "buttonBrowse"; this.buttonBrowse.Size = new System.Drawing.Size(24, 23); this.buttonBrowse.TabIndex = 3; this.buttonBrowse.Text = "..."; this.buttonBrowse.Click += new System.EventHandler(this.buttonBrowse_Click); // // cbUserSound // this.cbUserSound.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbUserSound.Items.AddRange(new object[] { ""}); this.cbUserSound.Location = new System.Drawing.Point(96, 48); this.cbUserSound.Name = "cbUserSound"; this.cbUserSound.Size = new System.Drawing.Size(168, 21); this.cbUserSound.TabIndex = 4; this.cbUserSound.SelectedIndexChanged += new System.EventHandler(this.cbUserSound_SelectedIndexChanged); // // label2 // this.label2.Location = new System.Drawing.Point(16, 48); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(80, 23); this.label2.TabIndex = 5; this.label2.Text = "Sound Events:"; // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(368, 93); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.label2, this.cbUserSound, this.buttonBrowse, this.buttonPlay, this.tbFileName, this.label1}); this.MaximizeBox = false; this.Name = "Form1"; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.Text = ".NET Sound Player"; this.ResumeLayout(false); } #endregion /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.Run(new WinForm()); } /// <summary> /// Plays selected wave file /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <remarks>If PlaySound can't find the specified file, it tries to /// play the default Windows sound. If it also can't find that, it /// returns false</remarks> private void buttonPlay_Click(object sender, System.EventArgs e) { int err = 0; // last error try { // play the sound from the selected filename if (!PlaySound( tbFileName.Text, IntPtr.Zero, SoundFlags.SND_FILENAME | SoundFlags.SND_ASYNC )) MessageBox.Show(this, "Unable to find specified sound file or default Windows sound"); } catch { err = Marshal.GetLastWin32Error(); if (err != 0) MessageBox.Show( this, "Error " + err.ToString(), "PlaySound() failed", MessageBoxButtons.OK, MessageBoxIcon.Error ); } } private void buttonBrowse_Click(object sender, System.EventArgs e) { string sysRoot = System.Environment.SystemDirectory; OpenFileDialog dlg = new OpenFileDialog(); dlg.AddExtension = true; dlg.Filter = "Wave files (*.wav)|*.wav|All files (*.*)|*.*" ; dlg.InitialDirectory = sysRoot + @"\..\Media"; // start in media folder // open dialog if(dlg.ShowDialog(this) == DialogResult.OK) { tbFileName.Text = dlg.FileName; } } private void tbFileName_TextChanged(object sender, System.EventArgs e) { if (tbFileName.Text.Length > 0) buttonPlay.Enabled = true; else buttonPlay.Enabled = false; } private void PopulateDropDown() { // fill our PropertyCollection object events = GetUserDefinedSounds(); // disable if no sound events if (events.Keys.Count == 0) cbUserSound.Enabled = false; else { foreach (string key in events.Keys) { cbUserSound.Items.Add(key); } } } /// <summary> /// Retrieves the user-defined sounds from the registry /// </summary> private PropertyCollection GetUserDefinedSounds() { string rootKey = "AppEvents\\Schemes\\Apps\\.Default"; PropertyCollection coll = new PropertyCollection(); try { // open root key key1 = Registry.CurrentUser.OpenSubKey(rootKey, false); // go through each subkey foreach (string subKey in key1.GetSubKeyNames()) { // open subkey key2 = key1.OpenSubKey(subKey + "\\.Current", false); // get filename, if any if (key2 != null) if (key2.GetValue(null).ToString().Length > 0) coll.Add(subKey, key2.GetValue(null).ToString()); } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Yikes!", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { // close keys key1.Close(); key2.Close(); } return coll; } private void cbUserSound_SelectedIndexChanged(object sender, System.EventArgs e) { // return the filename from the key tbFileName.Text = events[cbUserSound.SelectedItem].ToString(); } } } ![]() ![]() ![]() ![]() ![]() 发帖时间:8/13/2003 5:01:23 PM March 09 QQ空间封不住的变换皮肤代码QQ空间封不住的变换皮肤代码及皮肤QQ空间封不住的变换皮肤代码及皮肤 其实,我们不但可以使用黄钻才可以使用的背景,还可以随心所欲的使用空间的任何皮肤背景和自已设计好背影图片。自己设计的背景先上传到相册中。再改一下上面代码中的图片网络位置,就可以让自己的背景与众不同,很有特色的。转自建站下载 http://jzdown.com *****决对可用皮肤代码:(请将皮肤地址放在下面代码中) 转自建站下载 http://jzdown.com <img src="javascript:document.getElementById('all').style.background='url(图片地址)';" style="display:none;"> 先发皮肤地址: 图片地址:http://droson.blogchina.com/inc/pifu5.gif 图片地址:http://droson.blogchina.com/inc/pifu4.gif 图片地址:http://droson.blogchina.com/inc/pifu3.gif 图片地址:http://droson.blogchina.com/inc/pifu2.gif 图片地址:http://droson.blogchina.com/inc/pifu1.gif 下面我就说明一下,现在空间中所有黄钻专用皮肤的网络位置: 网络位置:http://imgcache.qq.com/qzone/item/orig/11/779.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/10/746.jpg 网络位置:http://imgcache.qq.com/qzone/item/orig/1/753.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/7/759.jpg 网络位置:http://imgcache.qq.com/qzone/item/orig/14/750.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/9/777.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/7/775.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/6/774.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/4/772.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/5/773.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/2/770.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/15/751.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/1/769.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/13/765.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/12/764.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/10/762.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/9/761.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/6/758.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/3/755.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/4/756.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/5/757.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/13/749.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/12/748.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/9/745.jpg 网络位置:http://imgcache.qq.com/qzone/item/orig/7/743.gif 网络位置:http://imgcache.qq.com/qzone/item/orig/14/766.jpg 转自建站下载 http://jzdown.com 修改一下: <img src="http://imgcache.qq.com/qzone/item/orig/5/757.gif" onload="document.getElementById('all').style.background='url(http://imgcache.qq.com/qzone/item/orig/5/757.gif)';" style="display:none;"> 这个代码弄好之后就会发现有了新的背景~然后把再打一次 转自建站下载 http://jzdown.com <img src="http://imgcache.qq.com/qzone/item/orig/5/757.gif" onload="document.getElementById('all').style.background='url(http://imgcache.qq.com/qzone/item/orig/5/757.gif)';" style="display:none;"> 就会有2个模块。把模块藏好了,保存就会出现变换的QQ背景了~ 转自建站下载 http://jzdown.com 转自建站下载:http://www.jzdown.com qq空间代码全集天气预报代码: 转自建站下载 http://jzdown.com <iframe name="I1" src="http://weather.qq.com/inc/ss150.htm" width="250" height="240"> </iframe>
背景音乐代码: 视频MTV代码:(地址要以.rm/.wmv/.asf/.avi/.mpg结尾) 代码 艺术字代码: 设为首页/加入收藏代码: |
|
||||||
|
|