vb.net_study

 

 

0:添加控件屬性

Me.btnDEL.Attributes("onClick") =”要進行的js操作動作”

Me.btnDEL.Attributes("onClick",”要進行的js操作動作”)

兩則有同樣的效果!

 

1:在JS,VS中取到一個文件,並判斷它的大小,長度

在(js中)

var fso = new ActiveXObject('Scripting.FileSystemObject');

var file = fso.GetFile(document.FrmDataAll.txtUpFilePathC.value);

var filesize= file.size;(注解: 2M =2*(1024*1024))

在(vs中)

Set objFS = CreateObject("Scripting.FileSystemObject")

objFS.GetFile(filepath)

objFS.FileExists(filepath)

objFS.DeleteFile(filepath)

2:如果運用ftp上傳文件及其實操作(vs中)

設定參數的部分:

    SET gobjftp =CreateObject("ftpObject.FtpClass")

    gobjftp.FtpUsrID =strUserID

    gobjftp.FtpPassWord =strpwd

FTP_TRANSFER_TYPE_BINARY = &H2

    wsRcvNum=0

實際連接的部分:

If gobjftp.ConnectFtpSite(strftpSvrname) = "Success" Then

        If gobjftp.SetCurrentDir(strftpPath) <> "Success" Then         

            gobjftp.CreateDir(strftpPath)

            gobjftp.CreateDir(strftpPath & stryear)

        End If 

        If gobjftp.SetCurrentDir(strftpPath & stryear & "/" & strunit) <> "Success" Then

            gobjftp.CreateDir(strftpPath & stryear & "/" & strunit)

        End If

        gobjftp.PutFile oldfilepath,strftpPath & stryear & "/" & strunit & "/" & wsFileName

        wsRcvNum=1

關連接的部分:

    gobjftp.CloseFtpConnect

End if

Download_file=wsRcvNum

3:運用word對文件進行操作:(vs中)

    Set myDocs = CreateObject("Word.Application")

    myDocs.Visible = TRUE----是否顯示文檔內容

    myDocs.Documents.Open(msTEMP_RTF1)----打開文件

myDocs.printout()-----進行列印

    set myDocs=nothing

4:option數據重新bind(js)

        newOpt=new Option('','');

    objUSER.options[0]=newOpt;

    var temp=tempxmlRtn.split("**"); 

    for (var i=0;i<temp.length;i++)

    {

        var subtemp=temp[i].split("##");

        newOpt=new Option(subtemp[1],subtemp[0]);//new Option(text,value)

        objUSER.options[i+1]=newOpt;

}

5:option數據重新bind(APS.NET)

Dim li As ListItem = New ListItem

    li.Value = "0"

    li.Text = "0─密等以上"

    cboSOURCE_SCUR.Items.Insert(1, li)

    象這樣子一個個插入就可以了!

6:取到系統日期,時間(APS.NET)

    Dim Source_Date As String

    Source_Date = DateTime.Now.ToString("yyyy/MM/dd")---取在西元年

AP_CDATE = Format(CInt(Source_Date.Substring(0, Source_Date.IndexOf("/"))) - 1911, "000") + Source_Date.Substring(Source_Date.IndexOf("/"))---取在民國年

Dim Source_Time as sring

Source_Time =DateTime.Now.ToString("HH:mm:ss")---系統時間

 

Dim strDate As String = Format(DateTime.Now.Year() - 1911, "000") + "/" + DateTime.Now.ToString("MM") + "/" + DateTime.Now.ToString("dd")

Dim strTime As String = DateTime.Now.ToString("HH") + ":" + DateTime.Now.ToString("mm") + ":" + DateTime.Now.ToString("ss")

7:設定一個控件的class及替代字符,重新編碼(js)

        document.FrmDataAll.txtPROC_DAYS.className="distext";

     StrNAE.replace('<ID>','').replace('</ID>','');

    STRTEST=Escape(“TEST”);---重新編碼

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值