Click here to Skip to main content
15,921,959 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionUsing print spooler to update shared log file Pin
Roy Barkas7-May-09 11:15
Roy Barkas7-May-09 11:15 
AnswerRe: Using print spooler to update shared log file Pin
Dave Kreskowiak7-May-09 14:28
mveDave Kreskowiak7-May-09 14:28 
GeneralRe: Using print spooler to update shared log file Pin
Roy Barkas7-May-09 21:48
Roy Barkas7-May-09 21:48 
GeneralRe: Using print spooler to update shared log file Pin
Dave Kreskowiak8-May-09 0:31
mveDave Kreskowiak8-May-09 0:31 
Questiondatatype conversion problem when fetching fromn database Pin
Ankit Aneja7-May-09 7:42
Ankit Aneja7-May-09 7:42 
AnswerRe: datatype conversion problem when fetching fromn database Pin
Dave Kreskowiak7-May-09 10:00
mveDave Kreskowiak7-May-09 10:00 
GeneralRe: datatype conversion problem when fetching fromn database Pin
Ankit Aneja7-May-09 11:02
Ankit Aneja7-May-09 11:02 
QuestionRAS option RASEO_RequireDataEncryption not work Pin
xmen3317-May-09 5:33
xmen3317-May-09 5:33 
Hi all

I want to create a RAS(PPTP) entry without "Require data encryption(disconnect if none)", below is my code. I have tried several times, but the option "RASEO_RequireDataEncryption" seems not work. But other option such as "RASEO_RemoteDefaultGateway" works fine. Can someone help? Thanks in advance!

------------------------------------------------------------
Enum RasEntryOptions
' 0-3
RASEO_UseCountryAndAreaCodes = &H1
RASEO_SpecificNameServers = &H4
RASEO_IpHeaderCompression = &H8
'4-7
RASEO_RemoteDefaultGateway = &H10
RASEO_DisableLcpExtensions = &H20
RASEO_TerminalBeforeDial = &H40
RASEO_TerminalAfterDial = &H80
'8-11
RASEO_ModemLights = &H100
RASEO_SwCompression = &H200
RASEO_RequireEncryptedPw = &H400
RASEO_RequireMsEncryptedPw = &H800
'12-15
RASEO_RequireDataEncryption = &H1000
RASEO_NetworkLogon = &H2000
RASEO_UseLogonCredentials = &H4000
RASEO_PromoteAlternates = &H8000
'16-19
RASEO_SecureLocalFiles = &H10000
RASEO_RequireEAP = &H20000
RASEO_RequirePAP = &H40000
RASEO_RequireSPAP = &H80000
'20,21,23
RASEO_Custom = &H100000
RASEO_PreviewPhoneNumber = &H200000
RASEO_SharedPhoneNumbers = &H800000
'24-27
RASEO_PreviewUserPw = &H1000000
RASEO_PreviewDomain = &H2000000
RASEO_ShowDialingProgress = &H4000000
RASEO_RequireCHAP = &H8000000
'28-31
RASEO_RequireMsCHAP = &H10000000
RASEO_RequireMsCHAP2 = &H20000000
RASEO_RequireW95MSCHAP = &H40000000
RASEO_CustomScript = &H80000000
End Enum

Function CreateNewEntry(ByVal sUsername As String, ByVal sPassword As String, ByVal sIP As String) As Boolean
CreateNewEntry = False

Dim re As RASENTRY
Dim sDeviceName As String ', sDeviceType As String
sDeviceName = "WAN Miniport(PPTP)"

With re
.dwSize = LenB(re)
.dwCountryCode = 86
.dwCountryID = 86
.dwDialExtraPercent = 75
.dwDialExtraSampleSeconds = 120
.dwDialMode = 1
.dwEncryptionType = 3
.dwfNetProtocols = 4
.dwfOptions = RASEO_RequireDataEncryption + RASEO_RemoteDefaultGateway
.dwFramingProtocol = 1
.dwHangUpExtraPercent = 10
.dwHangUpExtraSampleSeconds = 120
.dwRedialCount = 3
.dwRedialPause = 3
.dwVpnStrategy = VS_PptpOnly
.dwType = 5
CopyMemory .szLocalPhoneNumber(0), ByVal sIP, Len(sIP)
CopyMemory .szDeviceName(0), ByVal sDeviceName, Len(sDeviceName)
CopyMemory .szDeviceType(0), ByVal sDeviceType, Len(sDeviceType)
End With

Dim rc As RASCREDENTIALS
With rc
.dwSize = LenB(rc)
.dwMask = 11
CopyMemory .szUserName(0), ByVal sUsername, Len(sUsername)
CopyMemory .szPassword(0), ByVal sPassword, Len(sPassword)
End With

Dim rtn As Long
If RasSetEntryProperties(vbNullString, sEntryName, re, LenB(re), 0, 0) = 0 Then
If RasSetCredentials(vbNullString, sEntryName, rc, 0) = 0 Then
CreateNewEntry = True
End If
End If
End Function
AnswerRe: RAS option RASEO_RequireDataEncryption not work Pin
Dave Kreskowiak7-May-09 6:03
mveDave Kreskowiak7-May-09 6:03 
QuestionOpen all files in a Folder Pin
vijay24827-May-09 5:05
vijay24827-May-09 5:05 
AnswerRe: Open all files in a Folder Pin
Dave Kreskowiak7-May-09 5:32
mveDave Kreskowiak7-May-09 5:32 
AnswerRe: Open all files in a Folder Pin
riced7-May-09 6:58
riced7-May-09 6:58 
AnswerRe: Open all files in a Folder Pin
riced7-May-09 8:46
riced7-May-09 8:46 
GeneralMessage Closed Pin
7-May-09 11:37
vijay24827-May-09 11:37 
GeneralRe: Open all files in a Folder Pin
riced7-May-09 12:22
riced7-May-09 12:22 
GeneralMessage Closed Pin
8-May-09 0:42
vijay24828-May-09 0:42 
GeneralRe: Open all files in a Folder Pin
riced9-May-09 1:18
riced9-May-09 1:18 
GeneralRe: Open all files in a Folder Pin
vijay24829-May-09 3:02
vijay24829-May-09 3:02 
QuestionDataGridView CheckBox column Pin
Paul McGann7-May-09 5:00
professionalPaul McGann7-May-09 5:00 
AnswerRe: DataGridView CheckBox column Pin
Henry Minute7-May-09 11:28
Henry Minute7-May-09 11:28 
GeneralRe: DataGridView CheckBox column Pin
Paul McGann7-May-09 13:08
professionalPaul McGann7-May-09 13:08 
GeneralRe: DataGridView CheckBox column Pin
Henry Minute8-May-09 1:57
Henry Minute8-May-09 1:57 
GeneralRe: DataGridView CheckBox column Pin
Paul McGann8-May-09 3:10
professionalPaul McGann8-May-09 3:10 
QuestionProblem with sstab control in vb 6.0 Pin
Member 30578877-May-09 3:53
Member 30578877-May-09 3:53 
AnswerRe: Problem with sstab control in vb 6.0 Pin
Tom Deketelaere7-May-09 4:19
professionalTom Deketelaere7-May-09 4:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.