【原】基于Windows Media Player, 写自己的播放器【有源码,可下载整个工程】

最近有客户问我,怎么把Windows Media Player 嵌套在自己的项目中。

以前我在Delphi下玩过Windows Media Player,可是在Microsoft Visual Studio 2008 没有测试过。

到网上搜索了一把,果然得到很多例子。

 

其中CSDN上有个例子写的不错,不过要扣5分【我就不去赚分了,呵呵】,这个是CSDN上地地址:

http://download.csdn.net/source/677561

下载文件名是: Enhanced+Windows+Media+Player+using+VS+2005+in+C#.zip

 

我这个例子就是用这个CSDN上提供的例子,是基于Microsoft Visual Studio 2005下开发的,我只是简单的把这个例子更新到Microsoft Visual Studio 2008 下,不过有点小麻烦,还好,我已经解决了。

 

不多说了,直接上代码,

 

ContractedBlock.gifExpandedBlockStart.gifWindows Media Player
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Threading;
using AxWMPLib;

namespace MediaPlayer
{
    
    
public partial class Form1 : Form
    {
        
public static Form1 form1;
        
public string oldPath;
        
//To Load all Songs specified in Default Path
        public DelegateLoadSongs m_loadSongs;
        
public delegate void DelegateLoadSongs();
        
//Thread used in loading all songs in Default Path.
        public Thread execloadSongs;
        
public ToolStripMenuItem parentItem;
        
//To Add individual song as a New MenuItem
        public DelegateAddSong m_AddSongs;
        
public delegate void DelegateAddSong(string path);
        
public Form1()
        {
            InitializeComponent();
        }

        
private void openToolStripMenuItem_Click(object sender, EventArgs e)
        { 
            
//To Select Songs.
            bool isFileExist = false;
            WMPLib.IWMPPlaylistCollection playlistColl;
            WMPLib.IWMPPlaylist playlist 
= axWindowsMediaPlayer1.newPlaylist("Test""");
            
if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
            {
                
//If multiple Songs are selected,
                
//than it will create a New Playlist and add those songs to that list and set it as Current PlayList.
                if (openFileDialog1.FileNames.Length > 1)
                {
                    playlistColl 
= axWindowsMediaPlayer1.playlistCollection;
                    playlist 
= playlistColl.newPlaylist("Test");
                    
if (recentFilesToolStripMenuItem.DropDownItems.Count == 0)
                    {
                        
foreach (string f in openFileDialog1.FileNames)
                        {
                            recentFilesToolStripMenuItem.DropDownItems.Add(f, 
null, recentFilesMenuItem_Click);
                            RecentListcontextMenuStrip.Items.Add(f, 
null, recentFilesMenuItem_Click);
                            WMPLib.IWMPMedia media 
= axWindowsMediaPlayer1.newMedia(f);
                            playlist.appendItem(media);
                        }
                    }
                    
else
                    {
                        
foreach (string f in openFileDialog1.FileNames)
                        {
                            isFileExist 
= false;
                            WMPLib.IWMPMedia media 
= axWindowsMediaPlayer1.newMedia(f);
                            playlist.appendItem(media);
                            
//To add to Recent Play List.
                            foreach (ToolStripItem item in recentFilesToolStripMenuItem.DropDownItems)
                            {
                                
if (item.Text == f)
                                {
                                    isFileExist 
= true;
                                    
break;
                                }
                            }
                            
//If selected Song is not Present in Recent Songs List previously,than it will add it.
                            if (!isFileExist)
                            {
                                recentFilesToolStripMenuItem.DropDownItems.Add(f, 
null, recentFilesMenuItem_Click);
                                RecentListcontextMenuStrip.Items.Add(f, 
null, recentFilesMenuItem_Click);
                            }
                        }
                    }
                    axWindowsMediaPlayer1.currentPlaylist 
= playlist;
                    axWindowsMediaPlayer1.Ctlcontrols.play();
                }
                    
//This Will add selected song to Recent PlayList and Plays it.
                else if (openFileDialog1.FileNames.Length == 1)
                {
                    axWindowsMediaPlayer1.URL 
= openFileDialog1.FileName;
                    form1.Text 
= axWindowsMediaPlayer1.URL;
                    
if (recentFilesToolStripMenuItem.DropDownItems.Count == 0)
                    {
                        recentFilesToolStripMenuItem.DropDownItems.Add(openFileDialog1.FileName, 
null, recentFilesMenuItem_Click);
                        RecentListcontextMenuStrip.Items.Add(openFileDialog1.FileName, 
null, recentFilesMenuItem_Click);
                    }
                    
else
                    {
                        
foreach (ToolStripItem item in recentFilesToolStripMenuItem.DropDownItems)
                        {
                            
if (item.Text == openFileDialog1.FileName)
                            {
                                isFileExist 
= true;
                                
break;
                            }
                        }
                        
if (!isFileExist)
                        {
                            recentFilesToolStripMenuItem.DropDownItems.Add(openFileDialog1.FileName, 
null, recentFilesMenuItem_Click);
                            RecentListcontextMenuStrip.Items.Add(openFileDialog1.FileName, 
null, recentFilesMenuItem_Click);
                        }
                    }
                }
                form1.Text 
= axWindowsMediaPlayer1.URL;
            }
        }
        
private void recentFilesMenuItem_Click(object sender, EventArgs e)
        {
            
try
            {
                
//This Will just plays the selected song from Recent PlayList.
                bool isFileExist = false;
                
if (File.Exists(((ToolStripItem)sender).Text))
                {
                    axWindowsMediaPlayer1.URL 
= ((ToolStripItem)sender).Text;
                    form1.Text 
= ((ToolStripItem)sender).Text;
                    
foreach (ToolStripItem item in recentFilesToolStripMenuItem.DropDownItems)
                    {
                        
if (item.Text == ((ToolStripItem)sender).Text)
                        {
                            isFileExist 
= true;
                            
break;
                        }
                    }
                    
if (!isFileExist)
                    {
                        recentFilesToolStripMenuItem.DropDownItems.Add(((ToolStripItem)sender).Text, 
null, recentFilesMenuItem_Click);
                        RecentListcontextMenuStrip.Items.Add(((ToolStripItem)sender).Text, 
null, recentFilesMenuItem_Click);
                    }
                }
            }
            
catch { }
        }

        
private void playToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
//To Play the selected song.
            axWindowsMediaPlayer1.Ctlcontrols.play();
        }

        
private void pauseToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
//To pause the selected song.
            axWindowsMediaPlayer1.Ctlcontrols.pause();
        }

        
private void stopToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
//To Stop the selected song.
            axWindowsMediaPlayer1.Ctlcontrols.stop();
        }

        
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
//To Exit Application.
            Application.Exit();
        }

        
private void topMostToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
//To Show Media Player on top of other Windows.
            if (topMostToolStripMenuItem.Checked)
            {
                topMostToolStripMenuItem.Checked 
= false;
                form1.TopMost 
= false;
                form1.ShowInTaskbar 
= true;
            }
            
else
            {
                topMostToolStripMenuItem.Checked 
= true;
                form1.TopMost 
= true;
                form1.ShowInTaskbar 
= false;
            }
        }
        
private void opacityToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
//To Set Opacity of the Form.
            if (opacityToolStripMenuItem.Checked)
            {
                opacityToolStripMenuItem.Checked 
= false;
                form1.Opacity 
= 1;
            }
            
else
            {
                opacityToolStripMenuItem.Checked 
= true;
                form1.Opacity 
= 0;
            }
        }
        
        
private void showInTaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
//To Set whether to display Form in TaskBar or not.
            if (showInTaToolStripMenuItem.Checked)
            {
                showInTaToolStripMenuItem.Checked 
= false;
                form1.ShowInTaskbar 
= false;
            }
            
else
            {
                showInTaToolStripMenuItem.Checked 
= true;
                form1.ShowInTaskbar 
= true;
            }
        }

        
private void axWindowsMediaPlayer1_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e)
        {
            
//Generic Error Message.
            MessageBox.Show("Error occureddot.gif");
        }

        
private void showBorderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
//To Set whether Form Border should be displayed or not.
            if (showBorderToolStripMenuItem.Checked)
            {
                showBorderToolStripMenuItem.Checked 
= false;
                form1.FormBorderStyle 
= FormBorderStyle.None;
            }
            
else
            {
                showBorderToolStripMenuItem.Checked 
= true;
                form1.FormBorderStyle 
= FormBorderStyle.Sizable;
            }
            
        }
        
private void notifyIcon1_DoubleClick(object sender, EventArgs e)
        {
            
//To Set Visibility of the Form.
            try
            {
                
if (form1.Visible)
                {
                    form1.Visible 
= false;
                    form1.Opacity 
= 1;
                }
                
else
                {
                    form1.Visible 
= true;
                }
            }
            
catch
            { }
        }

        
private void timer1_Tick(object sender, EventArgs e)
        {
            
//To Change NotifyIcon Image.
            try
            {
                Random r 
= new Random();
                notifyIcon1.Icon 
= new Icon("..\\..\\Images\\" + r.Next(1,11+ ".ico");
            }
            
catch { }
        }

        
private void menuStrip1_MouseHover(object sender, EventArgs e)
        {
            
//T Show Form Border.
            form1.FormBorderStyle = FormBorderStyle.Sizable;
        }

        
private void Form1_Load(object sender, EventArgs e)
        {
            
//To Load Recent PlayList Items,Default songs Path from the File.
            if (File.Exists(@"c:\Media PlayList\List.txt"))
            {
                StreamReader reader 
= new StreamReader(@"c:\Media PlayList\List.txt");
                
string fname = "";
                
while ((fname = reader.ReadLine()) != null)
                {
                    
if (!fname.StartsWith("----"))
                    {
                        recentFilesToolStripMenuItem.DropDownItems.Add(fname, 
null, recentFilesMenuItem_Click);
                        RecentListcontextMenuStrip.Items.Add(fname, 
null, recentFilesMenuItem_Click);
                    }
                    
else
                    {
                        
//Default Songs Path.
                        DefaultPathtoolStripTextBox.Text = fname.TrimStart('-');
                        
//To Load all songs present in Default Songs Path.
                        DefaultPathtoolStripTextBox_KeyDown(sender, null);
                    }
                }
                reader.Close();
            }
            
        }

        
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            
//To Save Recent PlayList Items,Default Songs Path to the file.
            if (!Directory.Exists(@"c:\Media PlayList"))
            {
                Directory.CreateDirectory(
@"c:\Media PlayList");
            }
            File.Delete(
@"c:\Media PlayList\List.txt");
            File.Create(
@"c:\Media PlayList\List.txt").Close();
            System.IO.StreamWriter writer 
= new StreamWriter(@"c:\Media PlayList\List.txt");
            
foreach (ToolStripMenuItem fItem in recentFilesToolStripMenuItem.DropDownItems)
            {
                writer.WriteLine(fItem.Text);
            }
            writer.WriteLine(
"----" + DefaultPathtoolStripTextBox.Text.Trim());
            writer.Close();
            
//To Kill the thread used to load Default Path Songs.
            if (execloadSongs != null)
            {
                
if (execloadSongs.IsAlive)
                {
                    execloadSongs.Abort();
                    execloadSongs 
= null;
                }
            }
        }

        
private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
//To Show Form Border.
            form1.FormBorderStyle = FormBorderStyle.Sizable;
        }
        
private void DeleteFListToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
//To Delete Recent Songs List.
            recentFilesToolStripMenuItem.DropDownItems.Clear();
            File.Delete(
@"c:\Media PlayList\List.txt");
        }

        
private void axWindowsMediaPlayer1_MouseUpEvent(object sender, _WMPOCXEvents_MouseUpEvent e)
        {
            
//To Set Visibility of Form's Border,MenuStrip.
            if (menuStrip1.Visible)
            {
                
if (!showBorderToolStripMenuItem.Checked)
                {
                    menuStrip1.Visible 
= false;
                    form1.FormBorderStyle 
= FormBorderStyle.None;
                    axWindowsMediaPlayer1.uiMode 
= "None";
                    axWindowsMediaPlayer1.windowlessVideo 
= true;
                }
            }
            
else
            {
                
if (!showBorderToolStripMenuItem.Checked)
                {
                    menuStrip1.Visible 
= true;
                    form1.FormBorderStyle 
= FormBorderStyle.Sizable;
                    axWindowsMediaPlayer1.uiMode 
= "full";
                    axWindowsMediaPlayer1.windowlessVideo 
= false;
                }
            }
        }
        
private void LoadAllSongs()
        {
            
try
            {
                
//To Load all songs present in Default Songs Path.
                string paths = DefaultPathtoolStripTextBox.Text.Trim();
                
string[] allpaths = paths.Split(';');
                
foreach (string path in allpaths)
                {
                    m_AddSongs 
= new DelegateAddSong(this.AddSong);
                    
if (Directory.Exists(path))
                    {
                        DirectoryInfo dirinfo1 
= new DirectoryInfo(Path.GetDirectoryName(path));
                        Image img 
= Image.FromFile("..\\..\\Images\\folder.gif");
                        parentItem 
= SongsListtoolStripMenuItem;
                        form1.getDirs(dirinfo1);
                        
if (recursivelyToolStripMenuItem.Checked)
                        {
                            LoadAllSongs(SongsListtoolStripMenuItem);
                        }
                    }
                }
            }
            
catch { }
        }
        
public void getDirs(DirectoryInfo d)
        {
            
//To Load All Directories.
            DirectoryInfo[] dirs = d.GetDirectories("*.*");
            getFiles(d);
            
foreach (DirectoryInfo dir in dirs)
            {
                
this.Invoke(m_AddSongs, new object[] { dir.FullName });
            }
        }
        
public void getFiles(DirectoryInfo d)
        {
            
//To Load All Files in a Directory.
            FileInfo[] files;
            files 
= d.GetFiles("*.*");
            
foreach (FileInfo file in files)
            {
                String fileName 
= file.FullName;
                
this.Invoke(m_AddSongs, new object[] { file.FullName + "??" });
            }
        }
        
private void LoadAllSongs(ToolStripMenuItem item)
        {
            
//Recursion used to load all directory's contents.
            foreach (ToolStripMenuItem item1 in item.DropDownItems)
            {
                
if (oldPath != item1.Text)
                {
                    
if (item1.Image != null)
                    {
                        parentItem 
= item1;
                        oldPath 
= item1.Text;
                        form1.getDirs(
new DirectoryInfo(item1.Text));
                        LoadAllSongs(item1);
                    }
                }
            }
        }
        
private void AddSong(string path)
        {
            
try
            {
                
//To add a song to the Default songs LIst
                if (path.EndsWith("??"))
                {
                    
//To Add Files without any Image in it.
                    parentItem.DropDownItems.Add(path.TrimEnd('?'), null, recentFilesMenuItem_Click);
                }
                
else
                {
                    ToolStripMenuItem item 
= new ToolStripMenuItem();
                    Image img 
= Image.FromFile("..\\..\\Images\\folder.gif");
                    item.Text 
= path.TrimEnd('?');
                    item.Image 
= img;
                    parentItem.DropDownItems.Add(item);
                }
            }
            
catch { }
        }
        
private void DefaultPathtoolStripTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            
//To Load all Songs,Once Default Songs Path is Changed.
            if (e == null)
            {
                SongsListtoolStripMenuItem.DropDownItems.Clear();
                m_loadSongs 
= new DelegateLoadSongs(this.LoadAllSongs);
                ThreadStart ts 
= new ThreadStart(this.m_loadSongs);
                execloadSongs 
= new Thread(ts);
                execloadSongs.Start();
                
return;
            }
            
if (e.KeyCode == Keys.Enter)
            {
                SongsListtoolStripMenuItem.DropDownItems.Clear();
                m_loadSongs 
= new DelegateLoadSongs(this.LoadAllSongs);
                ThreadStart ts 
= new ThreadStart(this.m_loadSongs);
                execloadSongs 
= new Thread(ts);
                execloadSongs.Start();
            }
        }

        
private void recursivelyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
//To Set whether songs should be loaded recursively in Folders or not.
            if (recursivelyToolStripMenuItem.Checked)
            {
                recursivelyToolStripMenuItem.Checked 
= false;
            }
            
else
            {
                recursivelyToolStripMenuItem.Checked 
= true;
            }
        }
        
private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)
        {
            
if (e.Button == MouseButtons.Middle)
            {
                
//To change the Player status on Click on NotifyIcon using Middle Mouse's Button.
                if (axWindowsMediaPlayer1.status != "")
                {
                    
if (axWindowsMediaPlayer1.status.ToLower().StartsWith("playing"))
                    {
                        axWindowsMediaPlayer1.Ctlcontrols.pause();
                    }
                    
else if (axWindowsMediaPlayer1.status.ToLower().StartsWith("paused"))
                    {
                        axWindowsMediaPlayer1.Ctlcontrols.play();
                    }
                }
            }
        }
    }
}

下面是整个工程, 

http://files.cnblogs.com/OceanChen/WindowsMediaPlayer.rar

注意:在运行工程之前,需要先添加AxInterop.WMPLib.dll,Interop.MediaPlayer.dll,Interop.WMPLib.dll引用

转载于:https://www.cnblogs.com/OceanChen/archive/2009/03/06/1404685.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/411490.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

[html] 说说你对cookie和session的理解

[html] 说说你对cookie和session的理解 cookie: 可以通过客户端, 服务端设置, 容量小, 可以通过设置domain来实现同步登录, 除了name, value, 它还有多个选项, domain, path, secure, expires, 客户端和服务端可以通过cookie来通讯, 传递信息session: 由服务端设置并发起, 是服…

Oracle数据库php短连接,PHP 连接 Oracle

起因由于项目的数据库需要用客户购买的Oracle数据库,所以需要php安装oci扩展。运行环境php : 7.2系统: windows10oracle: 11gR2安装相关环境由于php的oci8扩展还是需要使用到oracle的一些包,所以先下载这一些。下载完成后解压缩这个压缩包,并…

java的内存模型--jmm

java虚拟机运行时的数据区 1.线程共享区(方法区,Java堆) 2.线程独占区(虚拟机栈,本地方法栈,程序计数器) 程序计数器:记录当前线程所执行到的字节码的行号转载于:https://www.cnblog…

计算机考研文章精选[转载]

今天在网上看到了一篇超全的计算机考研文章集合,里面有很多曾经看过,挺经典的,于是忍不住收藏下来,希望对那些即将报考计算机研究生和工作了仍不放弃考研的朋友有所帮助 计算机考研常见问题解答 地址:http://ww…

PHP鼠标滑过变色命令,WordPress鼠标悬停变色的修改方法

原创内容,转载请注明出处:https://www.myzhenai.com.cn/post/3253.html关键词:wordpress 鼠标 悬停 变色我总是觉得我两个WordPress博客的主题里使用的鼠标悬停变色的颜色不太喜欢,就是当鼠标划过或停留在某一个链接上的时候&…

圆面积异常

package zengliang;import java.util.*;public class Suv {public static void main(String[] args) {// TODO 自动生成的方法存根try{double r,s;final double PI 3.14;Scanner scnew Scanner(System.in);System.out.println("输入圆的半径:");r sc.ne…

[html] html5哪些标签可以优化SEO?

[html] html5哪些标签可以优化SEO? 跟标签语义化有关,从上往下:meta titlenav header main article section aside footerfigure picture time video audio个人简介 我是歌谣,欢迎和大家一起交流前后端知识。放弃很容易, 但坚持…

sql语句的效率

1、尽量避免反复访问同一张或几张表,尤其是数据量较大的表,可以考虑先根据条件提取数据到临时表中,然后再做连接。 2、尽量避免使用游标,因为游标的效率较差,如果游标操作的数据超过1万行,那么就应该改写&a…

php跳转分站,PHP判断IP并转跳到相应城市分站的方法

本文实例讲述了PHP判断IP并转跳到相应城市分站的方法。分享给大家供大家参考。具体实现方法如下:class QQWry{var $StartIP0;var $EndIP0;var $Country;var $Local;var $CountryFlag0;// 标识 Country位置// 0x01,随后3字节为Country偏移,没有Local// 0x02,随后3字节…

SpringBoot学习笔记(9)----SpringBoot中使用关系型数据库以及事务处理

在实际的运用开发中,跟数据库之间的交互是必不可少的,SpringBoot也提供了两种跟数据库交互的方式。 1. 使用JdbcTemplate 在SpringBoot中提供了JdbcTemplate模板类,JdbcTemplate提供的方法进行增删改查的操作。 首先需要在pom文件中添加依赖:…

[html] webSocket怎么做兼容处理?

[html] webSocket怎么做兼容处理? Socket.IO:Adobe Flash Socket(缺点:需要在服务器上打开一个额外的端口,默认为10843)Ajax long pollingAjax multipart streamingForever iframeJSONP polling个人简介 我是歌谣&am…

农民第六次拯救中国

农民第六次拯救中国 英国《金融时报》中文网专栏作家吴晓波 2008-11-18 1989年,我第一次行走中国。在此之前,我是一个成长在江南城市里的文学青年,我只读到过课本上的中国,在用5个月时间踏遍南部中国之后,我在社会底层…

java base64转bitmap,如何将Bitmap位图与base64字符串相互转换

先引用delphi自带的单元uses EncdDecd;然后就可以使用下面二个函数了:///将Bitmap位图转化为base64字符串function BitmapToString(img:TBitmap):string ;varms:TMemoryStream;ss:TStringStream;s:string;beginms : TMemoryStream.Create;img.SaveToStream(ms);ss : TStringStr…

剑指offer——用两个栈实现队列

题目:用两个栈来实现一个队列,完成队列的Push和Pop操作。 队列中的元素为int类型。 解题思路: 当stack2不为空时,在stack2中的栈顶元素是最先进入队列的元素,可以弹出。当stack2为空时,我们把stack1中的元素…

[html] 解释下什么是ISISO8859-2字符集?

[html] 解释下什么是ISISO8859-2字符集? 这个知识点在非科班的来看算是比较偏门的了。 查了一下才知道,原来是Ascll扩展部分的字符集。ISO/IEC 8859-1,又称Latin-1或“西欧语言”,ISO/IEC 8859-2 Latin-2或“中欧语言”&#xff…

常系数线性递推的第n项及前n项和(转载)

(一)Fibonacci数列f[n]f[n-1]f[n-2],f[1]f[2]1的第n项的快速求法(不考虑高精度). 解法: 考虑12的矩阵【f[n-2],f[n-1]】。根据fibonacci数列的递推关系,我们希望通过乘以一个22的矩阵,得到矩阵【…

Processes

转载于:https://www.cnblogs.com/EMH899/p/10844709.html

linux java 进程jvm 挂起,【jvm】jconsole远程linux上的java进程

1、启动java进程的命令在启动命令中添加如下信息-Djava.rmi.server.hostname192.169.1.71 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port10099 -Dcom.sun.management.jmxremote.authenticatefalse -Dcom.sun.management.jmxremote.sslfalse说明-Djava.r…

[html] 说说video标签中预加载视频用到的属性是什么?

[html] 说说video标签中预加载视频用到的属性是什么? 个人简介 我是歌谣,欢迎和大家一起交流前后端知识。放弃很容易, 但坚持一定很酷。欢迎大家一起讨论 主目录 与歌谣一起通关前端面试题

CodeSmith 5.0工具实例篇系列4——根据表生成修改的存储过程,针对MS Sqlserver

运行该模板时,只需要选择单个表即可。 申明:该系列案例已通过CodeSmith Professional 5.0.1 Revision 4983版本的测试,以及生成的存储过程是针对MS Sqlserver。 操作说明 :运行CodeSmith Studio工具 ,创建Blank Templa…