-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfrmMain.frm
More file actions
2194 lines (1946 loc) · 78.7 KB
/
Copy pathfrmMain.frm
File metadata and controls
2194 lines (1946 loc) · 78.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
VERSION 5.00
Object = "{79423413-BFDF-483D-BBB2-0D3B88187EB4}#1.0#0"; "WhoIs.ocx"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "richtx32.ocx"
Begin VB.Form frmMain
Caption = "Domain Manager Pro"
ClientHeight = 6390
ClientLeft = 600
ClientTop = 1155
ClientWidth = 10185
Icon = "frmMain.frx":0000
LinkTopic = "Form1"
ScaleHeight = 6390
ScaleWidth = 10185
StartUpPosition = 2 'CenterScreen
Begin WhoIsControl.WhoIs WhoIs1
Left = 4200
Top = 0
_ExtentX = 1508
_ExtentY = 661
Server = ""
Query = ""
End
Begin MSComDlg.CommonDialog CD
Left = 5040
Top = 1440
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Timer tmrAutoSave
Interval = 59000
Left = 5880
Top = 1440
End
Begin VB.Timer tmrDaily
Interval = 60000
Left = 6480
Top = 1440
End
Begin TabDlg.SSTab SSTab
Height = 6375
Left = 120
TabIndex = 0
Top = 0
Width = 9975
_ExtentX = 17595
_ExtentY = 11245
_Version = 393216
Tabs = 2
TabsPerRow = 2
TabHeight = 520
TabCaption(0) = "Domain Manager"
TabPicture(0) = "frmMain.frx":6852
Tab(0).ControlEnabled= -1 'True
Tab(0).Control(0)= "lblSelectAll"
Tab(0).Control(0).Enabled= 0 'False
Tab(0).Control(1)= "lblUnSelectAll"
Tab(0).Control(1).Enabled= 0 'False
Tab(0).Control(2)= "lblClearAll"
Tab(0).Control(2).Enabled= 0 'False
Tab(0).Control(3)= "lstDomains"
Tab(0).Control(3).Enabled= 0 'False
Tab(0).Control(4)= "frameQuickAdd"
Tab(0).Control(4).Enabled= 0 'False
Tab(0).Control(5)= "cmdLoadDomains"
Tab(0).Control(5).Enabled= 0 'False
Tab(0).Control(6)= "cmdScanDomains"
Tab(0).Control(6).Enabled= 0 'False
Tab(0).Control(7)= "cmdExportCSV"
Tab(0).Control(7).Enabled= 0 'False
Tab(0).Control(8)= "cmdStop"
Tab(0).Control(8).Enabled= 0 'False
Tab(0).ControlCount= 9
TabCaption(1) = "Whois"
TabPicture(1) = "frmMain.frx":688A
Tab(1).ControlEnabled= 0 'False
Tab(1).Control(0)= "lblWhois"
Tab(1).Control(1)= "lblWhoisInfo"
Tab(1).Control(2)= "txtDomainWhois"
Tab(1).Control(3)= "cmdWhois"
Tab(1).Control(4)= "Whois"
Tab(1).Control(5)= "txtWhoisInfo"
Tab(1).ControlCount= 6
Begin VB.CommandButton cmdStop
Caption = "STOP"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 8280
TabIndex = 26
Top = 480
Visible = 0 'False
Width = 1455
End
Begin RichTextLib.RichTextBox txtWhoisInfo
Height = 4575
Left = -74760
TabIndex = 15
Top = 1200
Width = 9615
_ExtentX = 16960
_ExtentY = 8070
_Version = 393217
ScrollBars = 3
TextRTF = $"frmMain.frx":7D7A
End
Begin WhoIsControl.WhoIs Whois
Left = -66600
Top = 480
_ExtentX = 873
_ExtentY = 661
Server = ""
Query = ""
End
Begin VB.CommandButton cmdWhois
Caption = "&Check Whois"
Height = 375
Left = -68880
TabIndex = 14
Top = 480
Width = 1215
End
Begin VB.TextBox txtDomainWhois
Height = 285
Left = -72360
TabIndex = 13
Top = 480
Width = 3255
End
Begin VB.CommandButton cmdExportCSV
Caption = "&Export CSV"
Height = 375
Left = 6840
TabIndex = 8
Top = 480
Width = 1335
End
Begin VB.CommandButton cmdScanDomains
Caption = "&Scan Domains"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 8280
TabIndex = 7
Top = 480
Width = 1455
End
Begin VB.CommandButton cmdLoadDomains
Caption = "&Load Text File"
Height = 375
Left = 5400
TabIndex = 6
Top = 480
Width = 1335
End
Begin VB.Frame frameQuickAdd
Caption = "Quick Domain Add"
Height = 735
Left = 240
TabIndex = 2
Top = 360
Width = 5055
Begin VB.CommandButton cmdBulkAddDomain
Caption = "&Bulk Add"
Height = 375
Left = 3840
TabIndex = 5
Top = 240
Width = 975
End
Begin VB.TextBox txtDomain
Height = 285
Left = 120
TabIndex = 4
Top = 240
Width = 2655
End
Begin VB.CommandButton cmdAddDomain
Caption = "&Add"
Height = 375
Left = 2880
TabIndex = 3
Top = 240
Width = 855
End
End
Begin MSComctlLib.ListView lstDomains
Height = 4575
Left = 120
TabIndex = 1
Top = 1200
Width = 9615
_ExtentX = 16960
_ExtentY = 8070
View = 3
Sorted = -1 'True
MultiSelect = -1 'True
LabelWrap = -1 'True
HideSelection = -1 'True
AllowReorder = -1 'True
FullRowSelect = -1 'True
GridLines = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 9
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "Domain"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "Registrar"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "Whois Server"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 3
Text = "Name Server 1"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 4
Text = "Name Server 2"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 5
Text = "Status"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(7) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 6
Text = "Updated Date"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(8) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 7
Text = "Created Date"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(9) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 8
Text = "Expiration Date"
Object.Width = 2540
EndProperty
End
Begin VB.Label lblClearAll
Alignment = 2 'Center
Caption = "Clear All Domains"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 255
Left = 8040
TabIndex = 30
Top = 960
Width = 1575
End
Begin VB.Label lblUnSelectAll
Alignment = 2 'Center
Caption = "UnSelect All"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 255
Left = 6360
TabIndex = 29
Top = 960
Width = 1215
End
Begin VB.Label lblSelectAll
Alignment = 2 'Center
Caption = "Select All"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 255
Left = 5400
TabIndex = 28
Top = 960
Width = 855
End
Begin VB.Label lblWhoisInfo
Caption = "Whois Information:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = -74760
TabIndex = 12
Top = 960
Width = 2895
End
Begin VB.Label lblWhois
Caption = "Enter domain name here:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = -74640
TabIndex = 11
Top = 480
Width = 2895
End
End
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnuFileImport
Caption = "Import Domains"
Begin VB.Menu mnuFileLoadDomains
Caption = "&Load Domains Text File"
Shortcut = ^L
End
Begin VB.Menu mnuImportSep1
Caption = "-"
End
Begin VB.Menu mnuFileLoadCSVData
Caption = "Load &CSV Data"
Shortcut = ^D
End
Begin VB.Menu mnuFileImportSep2
Caption = "-"
End
Begin VB.Menu mnuImportRecent
Caption = "Recent Files"
Begin VB.Menu mnuMRUFiles
Caption = "Files:"
Enabled = 0 'False
Index = 0
End
Begin VB.Menu mnuMRUFiles
Caption = ""
Index = 1
Visible = 0 'False
End
Begin VB.Menu mnuMRUFiles
Caption = ""
Index = 2
Visible = 0 'False
End
Begin VB.Menu mnuMRUFiles
Caption = ""
Index = 3
Visible = 0 'False
End
Begin VB.Menu mnuMRUFiles
Caption = ""
Index = 4
Visible = 0 'False
End
Begin VB.Menu mnuMRUFiles
Caption = ""
Index = 5
Visible = 0 'False
End
End
End
Begin VB.Menu mnuFileExport
Caption = "Export Domains"
Begin VB.Menu mnuFileExportDomains
Caption = "&Export Domains CSV"
Shortcut = ^E
End
Begin VB.Menu mnuExportSep1
Caption = "-"
End
Begin VB.Menu mnuFileExportSelectedCSV
Caption = "Export Selected Domains CSV"
End
End
Begin VB.Menu mnuFilePrint
Caption = "&Print Domains Infomation"
End
Begin VB.Menu mnuFileCheckExpire
Caption = "C&heck For Expiring Domains"
End
Begin VB.Menu mnuFileSep3
Caption = "-"
Index = 0
End
Begin VB.Menu mnuFileClearAllDomains
Caption = "&Clear All Domains"
End
Begin VB.Menu mnuFileSep1
Caption = "-"
End
Begin VB.Menu mnuFileMinimizeTray
Caption = "&Minimize To Tray"
Shortcut = ^M
End
Begin VB.Menu mnuFileSep2
Caption = "-"
End
Begin VB.Menu mnuFileExit
Caption = "E&xit"
End
End
Begin VB.Menu mnuToolsCustomize
Caption = "&Domains"
Begin VB.Menu mnuCustomColums
Caption = "Database Columns"
Visible = 0 'False
End
Begin VB.Menu mnuDomainsRawWhoisData
Caption = "Raw Whois Data Viewer"
End
Begin VB.Menu mnuDomainsImportRawWhois
Caption = "Import Raw Whois Data for current domains"
End
Begin VB.Menu mnuDomainsAvailability
Caption = "Bulk Availability Check"
End
Begin VB.Menu mnuCustomizeMenu
Caption = "Quick Links"
End
Begin VB.Menu mnuCustomizeSep1
Caption = "-"
End
Begin VB.Menu mnuOptions
Caption = "&Options"
End
End
Begin VB.Menu mnuSearch
Caption = "&Search"
End
Begin VB.Menu mnuReports
Caption = "&Reports"
Begin VB.Menu mnuReportsDomainReport
Caption = "Generate Domains Report"
End
End
Begin VB.Menu mnuHelp
Caption = "&Help"
Begin VB.Menu mnuHelpUpdates
Caption = "Check for Updates"
End
Begin VB.Menu mnuHelpLicenseKey
Caption = "Enter License Key"
End
Begin VB.Menu mnuHelpSep1
Caption = "-"
End
Begin VB.Menu mnuHelpAbout
Caption = "&About"
End
End
Begin VB.Menu mnuPopupMenu
Caption = "Popup"
Visible = 0 'False
Begin VB.Menu mnuPopupViewBrowser
Caption = "View in Browser"
End
Begin VB.Menu mnuPopupSep1
Caption = "-"
End
Begin VB.Menu mnuPopupCopyLine
Caption = "Copy Whole Line"
End
Begin VB.Menu mnuPopupCopy
Caption = "Copy to clipboard Domain"
End
Begin VB.Menu mnuPopupRescanDomain
Caption = "Rescan Domain"
End
Begin VB.Menu mnuPopUpEditDomain
Caption = "Edit Domain Information"
End
Begin VB.Menu mnuPopUpWhois
Caption = "Check Full Whois"
End
Begin VB.Menu mnuPopUpCustom
Caption = "Custom"
Index = 0
Visible = 0 'False
End
Begin VB.Menu mnuPopupSep2
Caption = "-"
End
Begin VB.Menu mnuPopupDelete
Caption = "Delete"
End
End
Begin VB.Menu mnuSort
Caption = "Sort"
Visible = 0 'False
Begin VB.Menu mnuSortAZ
Caption = "Ascending Order"
End
Begin VB.Menu mnuSortZA
Caption = "Decending Order"
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const SW_SHOWNORMAL = 1
Dim ClickedItem As Long
Dim prevOrder As Integer
Dim blnStop As Boolean
Dim blnScanning As Boolean 'guards against re-entrant scans (timers + DoEvents)
Dim ThreadInfo(9) As Boolean
Private Sub cmdBulkAddDomain_Click()
frmBulkAdd.Show
End Sub
Private Sub cmdExportCSV_Click()
Call ExportDomains
End Sub
Private Sub cmdLoadDomains_Click()
Call LoadDomains
End Sub
Private Sub cmdScanDomains_Click()
Call DomainScanner(-1)
End Sub
Private Sub DomainScanner(Range As Long)
On Error GoTo errHandle
Dim i As Long, Min As Long, Max As Long
Dim strDomainName As String
Dim strChanges As String
If blnScanning = True Then Exit Sub
blnScanning = True
cmdStop.Visible = True
cmdAddDomain.Enabled = False
cmdBulkAddDomain.Enabled = False
If Range = -1 Then
Min = 1
Max = Me.lstDomains.ListItems.count
Else
Min = Range
Max = Range
End If
blnStop = False
For i = Min To Max
If blnStop = True Then
blnScanning = False
Exit Sub
End If
strDomainName = lstDomains.ListItems.ITem(i).Text
'Remember current values so changes can be flagged after the rescan
Dim oldRegistrar As String, oldNS1 As String, oldNS2 As String
Dim oldStatus As String, oldExpiry As String
With lstDomains.ListItems.ITem(i)
oldRegistrar = Trim$(.SubItems(GetColByName("Registrar")))
oldNS1 = Trim$(.SubItems(GetColByName("Name Server 1")))
oldNS2 = Trim$(.SubItems(GetColByName("Name Server 2")))
oldStatus = Trim$(.SubItems(GetColByName("Status")))
oldExpiry = Trim$(.SubItems(GetColByName("Expiration Date")))
End With
' Check if we are getting the IP Address
If blnGetIPAddress = True Then
If SocketsInitialize() Then
'obtain and pass the host address to the function
lstDomains.ListItems.ITem(i).SubItems(GetColByName("IP Address")) = GetIPFromHostName(strDomainName)
SocketsCleanup
End If
End If
'DNS health: mail (MX) and actual delegated name servers straight
'from DNS - independent of whatever whois/RDAP claims
If blnDnsHealth = True Then
If GetColByName("MX") > 0 Then
lstDomains.ListItems.ITem(i).SubItems(GetColByName("MX")) = DnsGetMX(strDomainName)
End If
If GetColByName("DNS NS") > 0 Then
lstDomains.ListItems.ITem(i).SubItems(GetColByName("DNS NS")) = DnsGetNS(strDomainName)
End If
'fill IP Address here too, unless the winsock option already does
If blnGetIPAddress = False Then
If GetColByName("IP Address") > 0 Then
lstDomains.ListItems.ITem(i).SubItems(GetColByName("IP Address")) = DnsGetA(strDomainName)
End If
End If
End If
'Try RDAP first. Fall back to port-43 whois when the TLD has no RDAP
'service or the request fails.
Dim fRdapDone As Boolean
Dim rdap As RdapResult
fRdapDone = False
If blnUseRdap = True Then
rdap = RdapLookup(strDomainName)
'one polite retry on transient failures (not for TLDs with no RDAP)
If rdap.Success = False And InStr(1, rdap.ErrorMsg, "No RDAP") = 0 Then
Call PoliteDelay(lngScanDelayMs)
rdap = RdapLookup(strDomainName)
End If
If rdap.Success = True Then
With lstDomains.ListItems.ITem(i)
If rdap.NotRegistered = True Then
.SubItems(GetColByName("Status")) = "Not Registered"
Else
.SubItems(GetColByName("Registrar")) = rdap.Registrar
.SubItems(GetColByName("Whois Server")) = rdap.WhoisServer
.SubItems(GetColByName("Name Server 1")) = rdap.NS1
.SubItems(GetColByName("Name Server 2")) = rdap.NS2
.SubItems(GetColByName("Status")) = rdap.Status
.SubItems(GetColByName("Updated Date")) = rdap.UpdatedDate
.SubItems(GetColByName("Created Date")) = rdap.CreatedDate
.SubItems(GetColByName("Expiration Date")) = rdap.ExpirationDate
End If
End With
If blnRawWhois = True Then
Dim fJson As Long
fJson = FreeFile
Open App.Path & "\rawwhois\" & strDomainName & ".json" For Output As #fJson
Print #fJson, rdap.RawJson
Close #fJson
End If
fRdapDone = True
End If
End If
If fRdapDone = False Then
'Check what ending of domain is and then choose the whois server
Dim c As Long, fDomainWhoisSet As Boolean
fDomainWhoisSet = False
For c = 1 To UBound(WhoisServers)
If Right$(LCase$(strDomainName), Len(WhoisServers(c).Extension)) = WhoisServers(c).Extension Then
WhoIs1.Server = Trim$(WhoisServers(c).Server)
fDomainWhoisSet = True
Exit For
End If
Next
If fDomainWhoisSet = False Then
WhoIs1.Server = Trim$(WhoisServers(1).Server)
End If
'If Right$(LCase$(strDomainName), 4) = ".com" Then
' WhoIs1.Server = strWhoisDotCom
'ElseIf Right$(LCase$(strDomainName), 4) = ".net" Then
' WhoIs1.Server = strWhoisDotNet
'ElseIf Right$(LCase$(strDomainName), 4) = ".org" Then
' WhoIs1.Server = strWhoisDotOrg
'ElseIf Right$(LCase$(strDomainName), 4) = ".biz" Then
' WhoIs1.Server = strWhoisDotBiz
'ElseIf Right$(LCase$(strDomainName), 5) = ".info" Then
' WhoIs1.Server = strWhoisDotInfo
'Else
' WhoIs1.Server = strWhoisDotCom
'End If
WhoIs1.Query = strDomainName
WhoIs1.Connect
Dim strData As String
strData = WhoIs1.Result
If Trim$(strData) = "" Then
'one polite retry when the whois server returned nothing
Call PoliteDelay(lngScanDelayMs)
WhoIs1.Connect
strData = WhoIs1.Result
End If
Dim J As Long
Dim strTemp() As String
If WhoIs1.Server = strWhoisDotCom Or WhoIs1.Server = strWhoisDotNet Then
strTemp = Split(strData, vbLf)
Else
strTemp = Split(strData, vbCrLf)
End If
Dim NS1 As Boolean, TwoNS As Boolean
TwoNS = False
NS1 = False
'MsgBox UBound(strTemp)
For J = 0 To UBound(strTemp)
With lstDomains.ListItems.ITem(i)
If InStr(1, strTemp(J), "Registrar:") <> 0 Then
.SubItems(GetColByName("Registrar")) = Trim$(Replace(strTemp(J), "Registrar:", ""))
ElseIf InStr(1, strTemp(J), "Whois Server:") <> 0 Then
.SubItems(GetColByName("Whois Server")) = Trim$(Replace(strTemp(J), "Whois Server:", ""))
ElseIf InStr(1, strTemp(J), "Name Server:") <> 0 And TwoNS = False Then
If NS1 = False Then
.SubItems(GetColByName("Name Server 1")) = Trim$(Replace(strTemp(J), "Name Server:", ""))
NS1 = True
Else
.SubItems(GetColByName("Name Server 2")) = Trim$(Replace(strTemp(J), "Name Server:", ""))
TwoNS = True
End If
ElseIf InStr(1, strTemp(J), "Status:") <> 0 Then
.SubItems(GetColByName("Status")) = Trim$(Replace(strTemp(J), "Status:", ""))
ElseIf InStr(1, strTemp(J), "Updated Date:") <> 0 Then
.SubItems(GetColByName("Updated Date")) = NormalizeDateString(Replace(strTemp(J), "Updated Date:", ""))
ElseIf InStr(1, strTemp(J), "Last Updated On:") <> 0 Then
.SubItems(GetColByName("Updated Date")) = NormalizeDateString(Replace(strTemp(J), "Last Updated On:", ""))
ElseIf InStr(1, strTemp(J), "Created On:") <> 0 Then
.SubItems(GetColByName("Created Date")) = NormalizeDateString(Replace(strTemp(J), "Created On:", ""))
ElseIf InStr(1, strTemp(J), "Creation Date:") <> 0 Then
.SubItems(GetColByName("Created Date")) = NormalizeDateString(Replace(strTemp(J), "Creation Date:", ""))
ElseIf InStr(1, strTemp(J), "Expiration Date:") <> 0 Then
.SubItems(GetColByName("Expiration Date")) = NormalizeDateString(Replace(strTemp(J), "Expiration Date:", ""))
ElseIf InStr(1, strTemp(J), "Registry Expiry Date:") <> 0 Then
.SubItems(GetColByName("Expiration Date")) = NormalizeDateString(Replace(strTemp(J), "Registry Expiry Date:", ""))
End If
End With
DoEvents
Next
If blnRawWhois = True Then
Dim f As Long
f = FreeFile
Open App.Path & "\rawwhois\" & strDomainName & ".txt" For Output As #f
Print #f, strData
Close #f
End If
End If 'fRdapDone
'Flag meaningful changes vs the previous scan
With lstDomains.ListItems.ITem(i)
strChanges = strChanges & ChangeNote(strDomainName, "Registrar", oldRegistrar, Trim$(.SubItems(GetColByName("Registrar"))))
strChanges = strChanges & ChangeNote(strDomainName, "Name Server 1", oldNS1, Trim$(.SubItems(GetColByName("Name Server 1"))))
strChanges = strChanges & ChangeNote(strDomainName, "Name Server 2", oldNS2, Trim$(.SubItems(GetColByName("Name Server 2"))))
strChanges = strChanges & ChangeNote(strDomainName, "Status", oldStatus, Trim$(.SubItems(GetColByName("Status"))))
strChanges = strChanges & ChangeNote(strDomainName, "Expiration Date", oldExpiry, Trim$(.SubItems(GetColByName("Expiration Date"))))
End With
'Politeness: pause between lookups so servers are not hammered
If i < Max Then Call PoliteDelay(lngScanDelayMs)
DoEvents
Next
Call ColorCodeExpiry
If strChanges <> "" Then Call ReportDomainChanges(strChanges)
cmdStop.Visible = False
cmdAddDomain.Enabled = True
cmdBulkAddDomain.Enabled = True
blnScanning = False
'Call CheckDomainExpire
Exit Sub
errHandle:
blnScanning = False
MsgBox "Error: DomainScanner " & Err.Number & " " & Err.Description
End Sub
'One line of change report, or "" when nothing meaningful changed. A change
'only counts when the domain had a previous value that differs.
Private Function ChangeNote(ByVal Domain As String, ByVal Field As String, ByVal OldVal As String, ByVal NewVal As String) As String
If OldVal = "" Or NewVal = "" Then Exit Function
If LCase$(OldVal) = LCase$(NewVal) Then Exit Function
ChangeNote = Domain & ": " & Field & " changed from """ & OldVal & """ to """ & NewVal & """" & vbCrLf
'A dropped transfer lock is a classic hijack tell - call it out
If Field = "Status" Then
If InStr(1, Replace(LCase$(OldVal), " ", ""), "clienttransferprohibited") > 0 And _
InStr(1, Replace(LCase$(NewVal), " ", ""), "clienttransferprohibited") = 0 Then
ChangeNote = ChangeNote & " *** WARNING: transfer lock was removed on " & Domain & " - verify this was intentional! ***" & vbCrLf
End If
End If
End Function
'Append detected changes to changes.log and show them to the user
Public Sub ReportDomainChanges(ByVal strChanges As String)
On Error Resume Next
Dim f As Long
f = FreeFile
Open App.Path & "\changes.log" For Append As #f
Print #f, "=== " & Now & " ==="
Print #f, strChanges
Close #f
frmChanges.txtChanges.Text = strChanges
frmChanges.Show
End Sub
'Color rows by days-to-expiry: red = expired or inside the warning window,
'orange = within 90 days, default otherwise
Public Sub ColorCodeExpiry()
On Error Resume Next
Dim i As Long, g As Long, expCol As Long, days As Long
Dim sExp As String, rowColor As Long
expCol = GetColByName("Expiration Date")
If expCol <= 0 Then Exit Sub
For i = 1 To lstDomains.ListItems.count
With lstDomains.ListItems.ITem(i)
sExp = Trim$(.SubItems(expCol))
rowColor = vbWindowText
If IsDate(sExp) Then
days = DateDiff("d", Date, CDate(sExp))
If days <= ExpireDays Then
rowColor = vbRed
ElseIf days <= 90 Then
rowColor = &H80FF&
End If
End If
.ForeColor = rowColor
For g = 1 To .ListSubItems.count
.ListSubItems(g).ForeColor = rowColor
Next
End With
Next
lstDomains.Refresh
End Sub
'Once a minute, see whether a daily automatic rescan is due
Private Sub tmrDaily_Timer()
On Error Resume Next
If blnDailyRescan = False Then Exit Sub
If blnScanning = True Then Exit Sub
If lstDomains.ListItems.count = 0 Then Exit Sub
Dim lastRun As String
lastRun = GetSetting("Domain Manager Pro", "Options", "LastDailyRescan", "")
If lastRun <> "" Then
If DateDiff("h", CDate(lastRun), Now) < 24 Then Exit Sub
End If
SaveSetting "Domain Manager Pro", "Options", "LastDailyRescan", CStr(Now)
Call DomainScanner(-1)
End Sub
Private Sub mnuDomainsAvailability_Click()
frmAvailability.Show
End Sub
Private Sub cmdStop_Click()
blnStop = True
cmdStop.Visible = False
cmdAddDomain.Enabled = True
cmdBulkAddDomain.Enabled = True
End Sub
Private Sub cmdWhois_Click()
If txtDomainWhois.Text <> "" Then
txtWhoisInfo.Text = ""
'Try RDAP first. Fall back to port-43 whois when the TLD has no RDAP
'service or the request fails.
Dim fRdapDone As Boolean
Dim rdap As RdapResult
fRdapDone = False
If blnUseRdap = True Then
rdap = RdapLookup(Trim$(txtDomainWhois.Text))
If rdap.Success = True Then
txtWhoisInfo.Text = FormatRdapReport(rdap)
fRdapDone = True
End If
End If
If fRdapDone = False Then
'Check the extension of the domain and choose whois server
'If Right$(LCase$(txtDomainWhois.Text), 4) = ".com" Then
' Whois.Server = strWhoisDotCom
'ElseIf Right$(LCase$(txtDomainWhois.Text), 4) = ".net" Then
' Whois.Server = strWhoisDotNet
'ElseIf Right$(LCase$(txtDomainWhois.Text), 4) = ".org" Then
' Whois.Server = strWhoisDotOrg
'ElseIf Right$(LCase$(txtDomainWhois.Text), 4) = ".biz" Then
' Whois.Server = strWhoisDotBiz
'ElseIf Right$(LCase$(txtDomainWhois.Text), 5) = ".info" Then
' Whois.Server = strWhoisDotInfo
'Else
' Whois.Server = strWhoisDotCom
'End If
Dim c As Long, fDomainWhoisSet As Boolean
fDomainWhoisSet = False
For c = 1 To UBound(WhoisServers)
If Right$(LCase$(txtDomainWhois.Text), Len(WhoisServers(c).Extension)) = WhoisServers(c).Extension Then
Whois.Server = Trim$(WhoisServers(c).Server)
fDomainWhoisSet = True
Exit For
End If
Next
If fDomainWhoisSet = False Then
Whois.Server = Trim$(WhoisServers(1).Server)
End If
'Debug.Print "#" & WhoIs1.Server & "#"
'/Debug.Print "#" & strWhoisDotCom & "#"
' Whois.Server = strWhoisDotCom
'MsgBox WhoIs1.Server
Whois.Query = Trim$(txtDomainWhois.Text)
Whois.Connect
txtWhoisInfo.Text = Whois.Result
End If 'fRdapDone
Else
MsgBox "You did not enter a domain name!", vbInformation
End If
End Sub
Private Sub cmdAddDomain_Click()
If txtDomain.Text = "" Then
MsgBox "You need to enter a domain name.", vbInformation
Exit Sub
Else
Dim i As Long
'Check if domain is already in list
For i = 1 To Me.lstDomains.ListItems.count
If lstDomains.ListItems.ITem(i).Text = txtDomain.Text Then
MsgBox "You already have that domain listed.", vbInformation
Exit Sub
End If
Next
'Sanity checks
If InStr(Me.txtDomain.Text, ".") = False Then
MsgBox "You have entered an invalid domain name", vbInformation
Exit Sub
End If
txtDomain.Text = Replace(txtDomain.Text, "http://www", "")
txtDomain.Text = Replace(txtDomain.Text, "http://", "")
lstDomains.ListItems.Add , , txtDomain.Text
End If
End Sub
Private Sub Form_Load()
On Error GoTo errHandle:
Me.Tag = "Copyright VisualBasicZone.com 2006"
blnStartUp = GetSetting("Domain Manager Pro", "Options", "StartUp", "True")
If blnStartUp = True Then
Call modMain.RegRun(App.Path & "\DNManagerPro.exe tray", "DomainManagerPro")
Else
Call modMain.RemoveRegRun("DomainManagerPro")