VB开发程序要保存附件,应该什么控件?
是这样的,在存货系统中,想保存一些跟产品相关的图纸和报价资料,请问应该怎样实现?有没有哪位有相关的例子上传一个或发到我邮箱里。davyxjc@
Dim fs As New FileSystemObject Dim fw As TextStream If fs.FileExists(Path & "\" & "123.txt") = False Then '寫入檔案所指定的位子 Set fw = fs.OpenTextFile(Path & "\" & "123.txt", ForWriting, True) '會覆蓋 Else Set fw = fs.OpenTextFile(Path & "\" & "123.txt", ForAppending, True) '接在後面寫 End If
PictureIndex = GetObjectIndex(Picture1) Load Picture1(PictureIndex) Set PicAdd = Picture1(PictureIndex) Set Picture1(PictureIndex).Container = MSFlexGrid1.Container Picture1(PictureIndex).ZOrder 0 '调整重叠元件上下层顺序(Picture1和MSFlexGrid1的顺序)(先写在下) Frame1.ZOrder 0 '调整重叠元件上下层顺序(Picture1和Frame1的顺序)(后写在上) If m_ZoomCols = True Then PicAdd.Left = MSFlexGrid1.Left + MSFlexGrid1.ColPos(0) + 4 * Screen.TwipsPerPixelX PicAdd.Top = MSFlexGrid1.Top + MSFlexGrid1.RowPos(StartCol) + 4.4 * Screen.TwipsPerPixelY PicAdd.Picture = ImageList1.ListImages(1).Picture 'LoadPicture(icoPath1) ReDim Preserve m_ImageAdd(PictureIndex): m_ImageAdd(PictureIndex) = True MSFlexGrid1.ColAlignment(0) = flexAlignLeftCenter MSFlexGrid1.Col = 0 PicAdd.Visible = True MSFlexGrid1.TextMatrix(StartCol, 0) = StartCol & "-" & EndCol For i = StartCol To EndCol For j = 2 To MSFlexGrid1.Cols MSFlexGrid1.Row = i: MSFlexGrid1.Col = j - 1 MSFlexGrid1.CellBackColor = vbYellow Next j If i <> StartCol Then MSFlexGrid1.RowHeight(i) = 0 Next i End If ReDim Preserve ObjectPic(PictureIndex) ObjectPic(PictureIndex) = StartCol & "," & EndCol