社区
VB
帖子详情
问一下,使用Application.StartupPath需要引用哪些库呀!!!!!!
bitcat
2003-07-01 03:04:31
谢谢!
...全文
244
4
打赏
收藏
问一下,使用Application.StartupPath需要引用哪些库呀!!!!!!
谢谢!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
mainone
2003-07-01
打赏
举报
回复
windows.forms
bitcat
2003-07-01
打赏
举报
回复
对不起,是fileopen(.............)
bitcat
2003-07-01
打赏
举报
回复
我是用在fileread(application.startuppath & "")可是我说application 未声明,奇怪了
myhgo
2003-07-01
打赏
举报
回复
-------------
不用引用库就可以
Dim crdot As New ReportDocument()
crdot.Load(Application.StartupPath & "\reports\myrpt.rpt")
cr.ReportSource = crdot
--------------
Good Luck!
vb2010 软件注册方法
四知四清四握信息管理系统软件注册 编辑 | 删除 | 权限设置 | 更多▼ 更多▲ 设置置顶 推荐日志 转为私密日志 hamit 发表于2010年06月12日 16:15 阅读(2) 评论(0) 分类: 个人日记 权限: 公开 Imports System.Management Imports System.IO Public Class tizimlitix Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Trim(TextBox2.Text) = "" Then MsgBox("你必须输入<注册码>", MsgBoxStyle.Exclamation) Exit Sub End If If Trim(TextBox2.Text) = Trim(TextBox1.Text) * 2 - 9950019 Then ' 存入(机器码) If File.Exists(
Application
.
Startup
Path
+ "\tizim_id.txt") Then File.Delete(
Application
.
Startup
Path
+ "\tizim_id.txt") End If Dim sr As StreamWriter = File.CreateText(
Application
.
Startup
Path
+ "\tizim_id.txt") sr.WriteLine(TextBox2.Text) sr.Close() '存入(注册码) If File.Exists(
Application
.
Startup
Path
+ "\pc_id.txt") Then File.Delete(
Application
.
Startup
Path
+ "\pc_id.txt") End If Dim sr2 As StreamWriter = File.CreateText(
Application
.
Startup
Path
+ "\Pc_id.txt") sr2.WriteLine(TextBox1.Text) sr2.Close() MsgBox("注册成功!程序将要重新启动!", MsgBoxStyle.Exclamation) Me.Close() End Else MsgBox("注册码不正确!请软件开发者联系 13899326632", MsgBoxStyle.Exclamation) End If End Sub Private Sub tizimlitix_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cmicWmi As New System.Management.ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive") '获得硬盘序列号 2010-6-8 tordin izdap taptim hamdulla mahmut 13909950019 Dim Uint32 As UInt32 For Each cmicWmiObj As ManagementObject In cmicWmi.Get Uint32 = cmicWmiObj("signature") Next TextBox1.Text = Uint32.ToString * 2 - 13909950019 '本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/21aspnet/archive/2004/10/29/159124.aspx TextBox1.Enabled = False End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub End Class
读取写入TXT文件
读取写入TXT文件 if (this.textBox1.Text == "") { MessageBox.Show(this, "文件名不能为空!", "提示对话框", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { StreamWriter sw = new StreamWriter(
Application
.
Startup
Path
+ "\\" + textBox1.Text + ".txt"); sw.Write(textBox2.Text); sw.Flush(); sw.Close(); MessageBox.Show(this, "文件写入成功!", "提示对话框", MessageBoxButtons.OK, MessageBoxIcon.Information); }
条形码控件 BarCode
条形码控件 里面有示例 生成图片参照如下代码:
引用
BarCode.dll using Cobainsoft.Windows.Forms; BarcodeControl bar = new BarcodeControl(); bar.BarcodeType = BarcodeType.EAN13; bar.Data = "6901028133920"; bar.SaveImage(System.Drawing.Imaging.ImageFormat.Jpeg, 2, 100, true, false, null,
Application
.
Startup
Path
+ "\\bar.jpg");
当类
库
项目中无法
使用
Application
.
Startup
Path
通常我们WinForm编程时,要获取程序当前运行的文件夹路径会用
Application
.
Startup
Path
,但是
Application
.
Startup
Path
在编写类
库
项目时却无法
使用
,因为我们根本无法用using System.Windows.Forms;来引入
Application
.
Startup
Path
的命名空间,这个时侯我们要用AppDomain.CurrentDomain.Bas...
获取程序当前运行的文件夹路径“
Application
.
Startup
Path
”,在类
库
项目中无法
使用
的解决方案
通常我们WinForm编程时,要获取程序当前运行的文件夹路径会用
Application
.
Startup
Path
,但是
Application
.
Startup
Path
在编写类
库
项目时却无法
使用
,因为我们根本无法用using System.Windows.Forms;来引入
Application
.
Startup
Path
的命名空间,这个时侯我们要用AppDomain.CurrentDomain.BaseDirectory。 private static string full
Path
FileName = App
VB
16,556
社区成员
110,528
社区内容
发帖
与我相关
我的任务
VB
VB技术相关讨论,主要为经典vb,即VB6.0
复制链接
扫一扫
分享
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章