一段旧码

琢磨java

失眠

忽又想起几年前写的foolorm

现在想想,有些不尽美,因为当时软编码和硬编码我似乎没有拆的太开

转而脑子里又是go,反射搞得我晕头转向

再是php,从头到尾的kv编程…

突然发现自己最爱的语言还是c#

既有dynamic

又含attibute

没有go的死性

又不像php的随意

可惜,无用武之地了

附上当年的烂代码

搏君一乐吧

https://github.com/yfge/FoolFrame
展开阅读全文

初学者一段断码的疑问?

03-21

网上抄了一段代码rn运行时红色部分出错,请问原因,谢谢!rn错误提示为未找到类型SQLServer2”的公共成员“Createobject”rnrnrn'添加进度条ProgressBar1控件 rn'引用Microsoft SQLDMO Object Library rn'声明 rnrnPublic WithEvents bkps As SQLDMO.Backuprnrn'数据库备份操作 rnPrivate Sub btnBackUp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBackUp.ClickrnDim oSQLServer As New SQLDMO.SQLServer()rnoSQLServer.LoginSecure = Falsern[color=#FF0000]oSQLServer.Connect("(local)", "sa", "sa") '连接服务器 [/color]rnMe.Cursor = Windows.Forms.Cursors.WaitCursorrn[del]bkps = CreateObject("SQLDMO.Backup")[/del]bkps.Database = "Northwind" '指定需备份的数据库 rnbkps.Action = 0rnbkps.Files = "f:\Northwind.bak" '指定备份文件 rnbkps.Initialize = TruernProgressBar1.Value = 0rnProgressBar1.Maximum = 100rnMe.Cursor = Windows.Forms.Cursors.Default()rnApplication.DoEvents()rnDim mouseCur As CursorrnMe.Cursor = Windows.Forms.Cursors.WaitCursorrnbkps.SQLBackup(oSQLServer)rnProgressBar1.Value = 100rnApplication.DoEvents()rnbkps = NothingrnMe.Cursor = Windows.Forms.Cursors.Default()rnMsgBox("数据库备份完成", MsgBoxStyle.Information, "系统消息")rnEnd Subrnrn'显示进度 rnrnPrivate Sub bkps_PercentComplete(ByVal Message As String, ByVal Percent As Integer) Handles bkps.PercentCompleternProgressBar1.Value = ProgressBar1.Maximum * (Percent / 100)rnEnd Sub rnrn 论坛

一段ADOQuery的貸码?和函数。请教各位一下!在线等待

06-28

procedure TNew_person_add.person_list_add(Ename:TEdit;Epin,Eperson_tell,Eperson_QQ,Eperson_mail,Eperson_position,Eperson_addr:TEdit;Person_Age:integer);rnBeginrn Comman.UsernpQ.SQL.Clear;rn Comman.UsernpQ.SQL.Add('Select * from Person_Name_password');rn Comman.UsernpQ.Open;rn comman.UsernpQ.Append;rn comman.UsernpQ['user_name']:=Ename;rn comman.UsernpQ['user_password']:=Epin;rn Comman.UsernpQ['User_Birs']:=StrToInt(Person_Age);rn Comman.UsernpQ['User_Tell']:=Eperson_tell;rn Comman.UsernpQ['User_QQ']:=Eperson_QQ;rn Comman.UsernpQ['User_Email']:=Eperson_mail;rn Comman.UsernpQ['User_Position']:=Eperson_position;rn Comman.UsernpQ['User_Address']:=Eperson_addr;rnend;rnrn上面是函数體。rnrn下面是調用。rnprocedure TNew_person_add.B_addClick(Sender: TObject);rnbeginrn person_list_add(E_name,E_pin,E_person_tell,E_person_QQ,E_person_mail,E_person_position,E_person_addr,E_Age);rn IF application.MessageBox('妳確定輸入正確了?','操作正確吗?',MB_OKCANCEL)=Mrok thenrn comman.UsernpQ.Postrn Elsern comman.UsernpQ.Cancel;rnend;rnrn可是會一直出錯呀。rnrn[Error] Page4.pas(55): Incompatible types: 'Variant' and 'TEdit'rn [Error] Page4.pas(56): Incompatible types: 'Variant' and 'TEdit'rn [Error] Page4.pas(57): Incompatible types: 'String' and 'Integer'rn [Error] Page4.pas(58): Incompatible types: 'Variant' and 'TEdit'rn [Error] Page4.pas(59): Incompatible types: 'Variant' and 'TEdit'rn [Error] Page4.pas(60): Incompatible types: 'Variant' and 'TEdit'rn [Error] Page4.pas(61): Incompatible types: 'Variant' and 'TEdit'rn [Error] Page4.pas(62): Incompatible types: 'Variant' and 'TEdit'rn [Error] Page4.pas(70): Undeclared identifier: 'E_person_mail'rn [Error] Page4.pas(70): Incompatible types: 'Integer' and 'TEdit'rn [Fatal Error] page1.pas(34): Could not compile used unit 'Page4.pas'rnrn我要怎么做才行呢? 請各位指教一下。多謝。。。。。 论坛

没有更多推荐了,返回首页