接收pop3
Public Function Retrieve(ByVal rhs As Pop3Message) As Pop3Message
Dim message, response As String
Dim msg As New Pop3Message
msg.bytes = rhs.bytes
msg.number = rhs.number
message = "RETR " + rhs.number.ToString + vbCrLf
write(message)
response = Respond()
If response.Substring(0, 3) <> "+OK" Then
Throw New Pop3Exception(response)
End If
MsgBox(msg)
msg.retrieved = True
While (1 = 1)
response = Respond()
If response = "." + vbCrLf Then
Exit While
Else
msg.message += response
End If
End While
Return msg
End Function
This code detects memory leaks in embedded VC++ almost the same way crtdbg does in VC++. At the end of program execution it will display in the debug window if there were any memory leaks and how the memory looks so you can identify where your memory leak occurred. It will display in the debug window a message saying no memory leaks detected if there are no memory leaks. Similar to what crtdbg.h does in VC++. The code detects memory leaks generated with calls to new and delete operators in C++. The code doesn t detect memory leaks generated with C functions: malloc, calloc, free, but that can be done in the future. Let me know and I will program it.
Visual Basic 6.0可以通過調(diào)用API函數(shù)格式化一個(gè)磁盤,無論是軟盤還是硬盤。
打開一個(gè)新的項(xiàng)目(工程1) ,如果你沒有更改過缺省模式,那么Visual Basic 6.0會(huì)自動(dòng)添加一個(gè)form1文件,在form1上添加一個(gè)命令控件,將下面的代碼拷入。
Option Explicit
Private Declare Function SHFormatDrive Lib"shell32"( ByVal Hend AS Long,ByVal Drive AS Long,ByVal FormatID AS Long,ByVal Options AS Long) as Long
Private Sub FormatDisk(intDrive as integer,blnQuickFormat as Boolean)
dim lngReturn As Long
if (blnQuickFormat) then
lngReturn= SHFormatDrive(0,intDrive,0&,1&)
else
lngReturn= SHFormatDrive(0,intDrive,0&,0&)
end if
end Sub
Private Sub Command1_Click()
call FormatDisk(0,True)
End Sub
運(yùn)行此程序。
注意FormatDisk函數(shù)的第一個(gè)變量很重要,他的值是0,1,2時(shí)代表格式化的分別是:A、B、C盤。
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="conn.asp" -->
<%
ProductClass_2=request("ProductClass_2")
set rs=server.createobject("adodb.recordset")
sqltext="select * from Product"
if request("Product_Name")<>"" then
sqltext=sqltext &" where Product_Name like %"& request("Product_Name") &"% "
else
sqltext=sqltext &" where Product_Name like %"& "" &"% "
end if
if request("Product_Class")<>"" then
sqltext=sqltext &" and Class_1 like %"& request("Product_Class") &"% "
end if
DATA:BEGIN OF HEADDATA.
INCLUDE STRUCTURE BAPIMATHEAD.
DATA:END OF HEADDATA.
DATA:BEGIN OF PLANTDATA.
INCLUDE STRUCTURE BAPI_MARC.
DATA:END OF PLANTDATA.
DATA:BEGIN OF PLANTDATAX.
INCLUDE STRUCTURE BAPI_MARCX.
DATA:END OF PLANTDATAX.
READ TABLE XMKPF INDEX 1.
IF XMKPF-TCODE2 = MIGO_GR .
LOOP AT XMSEG.
#ifdef _AFXDLL
Enable3dControls() // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic() // Call this when linking to MFC statically
#endif
CPreviewDialogDlg dlg
m_pMainWnd = &dlg
int nResponse = dlg.DoModal()
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application s message pump.
return FALSE
}