کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

به اشتراک گذاری اطلاعات کسب شده در اکسس از سایت آفیس و سایت های تخصصی خارجی
کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

به اشتراک گذاری اطلاعات کسب شده در اکسس از سایت آفیس و سایت های تخصصی خارجی

decode SMS-SUBMIT



SMS-SUBMIT including : 
SCA-PDU TYPE-MR-DA-PID-DCS-VP-UDL-UD



0891683108200805F01151048181160000FF16C8329BFD66B5F320B8BC4CA7E741F7B79C4D0E01



-SMSC : 0891683108200805F0

--Length : 08 (2digit 2digit)

--number : 91683108200805F0

---International : 91 (+ )

---683108200805F0

Reverse 2digits

86 13 80 02 80 50 00

number is >>> +8613800280500

-PDU Type : 11

--00010001

>>>from right to left 

---MTI : 01 ( SMS SUBMIT )

---RD : 0 ( Reject duplicate )

---VPF : 10 means present see FF after DCS

---SRR : 0 status report not requested

---UDHI : 0 no header present in multi part sms

---RP : 0 (Replay path )

-MR : 51 in hex : 5×16+1=81

-DA : 04818116

--Length : 04

--Number : 818116

---national : 81

---8116

Reverse

1861

number >>> 1861

-PID : 00 ( Protocol ID )

-DCS : 00 ( Data coding scheme : alphabet 7bit )

-VPF : FF in hex 141 days

( Validity period format bit3,4 present in pdu type )

-UDL : 16

-UD : C8329BFD66B5F320B8BC4CA7E741F7B79C4D0E01---Decoding User Data 

C8329BFD66B5F320B8BC4CA7E7

41F7B79C4D0E01

---Reverse hex

01 0E 4D 9C B7 F7 41 E7 A7 4C

BC B8 20 F3 B5 66 FD 9B 32 C8

hex_count :20

---hex to binary

00000001 00001110 01001101

10011100 10110111 11110111

01000001 11100111 10100111

01001100 10111100 10111000

00100000 11110011 10110101

01100110 11111101 10011011

00110010 11001000

---Remove zeros from the left

20×8-int((20×(8/7))×7=6

20×822×7=6


00000001 00001110 01001101

10011100 10110111 11110111

01000001 11100111 10100111

01001100 10111100 10111000

00100000 11110011 10110101

01100110 11111101 10011011

00110010 11001000


---Seperate in 7bits

0100001 1100100 1101100

1110010 1101111 1110111

0100000 1111001 1110100

1110100 1100101 1110010

1110000 0100000 1111001

1101101 0101100 1101111

1101100 1101100 1100101

1001000

---Binary to hex


21 64 6C 72 6F 77 20 79 74

74 65 72 70 20 79 6D 2C 6F

6C 6C 65 48


---Reverse hex


48656C6C6F2C6D79207072657474

7920776F726C6421


hex_count=22>>>22÷16=1 Reminder=6

UDL=16


---Put hex here

https://codebeautify.org/hex-string-converter



Finally decoded done successfully.


Encoding : 

Hex_Count:22

Int(22×(7÷8))+1-22×7=6

Add 6 Zero to the first

Decoding : 

Hex_Count :20

20×8-int(20×(8/7))=6

Remove 6 zero from the first







GSM-7 messages break down as follows:

  • Standard single SMS messages: For GSM phones with 7-bit character encoding, a standard SMS message can contain a maximum of 160 characters. That is 1120 bits / (7 bits/character) = 160 characters for a single SMS message.
  • GSM-7 multi-part or concatenated messages: When the message text is longer than 160 GSM characters, the message is concatenated and sent. When a message is concatenated, the user data header (UDH) consumes 6 bytes or 48 bits. This reduces the maximum number of characters in each message part:

1120 bits - 48 bits = 1072 bits

1072 bits / (7 bits/character) = 153 characters per message part.





























decode SMS-SUBMIT




079144872000626011000C914477000910320011002154747A0E4ACF416190BD2CCF83E6E9369C5D06B5CBF379F85C06E95A29



-0791448720006260 : SMSC

--07 : Length(Hex)

---Number :

91448720006260

91 : International ( + )

448720006260

Reverse 2digits from left

number is ... 44 78 02 00 26 06

-11 : PDU Type

--00010001

bit0,1(from right) : 01 : MTI

SMS-SUBMIT :01 & DELIVER : 00

bit2 : 0 : RD ( Reject duplicate )

bit3,4 : 10 : VPF : present

bit5 : 0 : SRR

bit6: 0 : UDHI : not present ( for concatenated messages or multi part)

bit7 : 0 : RP ( Reply path )

-00 : MR ( Message refrence in hex )

-0C91447700091032 : DA (send To this)

--0C : Length in hex

C=0×16+12=12

---Number

91 : International ( + )

447700091032

Reverse 2digits from the left

number is ... 44 77 00 90 01 23

-00 : PID

-11 : DCS ( Data coding scheme )

Alphabet 7bit

--Group coding

General data coding

11 GSM 7BIT CLASS 1 (ME-specific)


-00 : VPF
( Ckeck bit3,4 of PDU Type [10] ,it means present)

-21 : UDL in hex

-54747A0E4ACF416190BD2CCF83E6E9369C5D06B5CBF379F85C06E95A29 : UD


---Decoding User Data ( UD )

Data coding is ... alphabet mode 


54747A0E4ACF416190BD2CCF8

3E6E9369C5D06B5CBF379F85C06

E95A29


-Reverse above Hex 

29 5A E9 06 5C F8 79 F3 CB B5 06 

5D 9C 36 E9 E6 83 CF 2C BD 90 61

41 CF 4A 0E 7A 74 54


-Hex to binary

00101001 01011010 11101001

00000110 01011100 11111000

01111001 11110011 11001011

10110101 00000110 01011101

10011100 00110110 11101001

11100110 10000011 11001111

00101100 10111101 10010000

01100001 01000001 11001111

01001010 00001110 01111010

01110100 01010100



Hex_Count (2digits)=29

How many zeros to be remove? ( from the left of binery [Octet])

29×8-int(29×8/7)×7=1


Remove 1 Zero from the left then Set to septet (7bit) All binaries

0101001 0101101 0111010

0100000 1100101 1100111

1100001 1110011 1110011

1100101 1101101 0100000

1100101 1101100 1110000

1101101 1101001 1110011

0100000 1111001 1110010

1100101 1110110 0100000

1100001 0100000 1110011

1101001 010 0000 1110011

1101001 1101000  1010100


-Binary to hex

Ex : 010 1001:010=2,1001:9

29 2D 3A 20 65 67 61 73 73

65 6D 20 65 6C 70 6D 69 73

20 79 72 65 76 20 61 20 73

69 20 73 69 68 54

-Reverse hex 

546869732069732061207665727920

73696D706C65206D65737361676520

3A2D29

Hex_Count=33

33 >>> 33÷16=2 Reminder=1>>21

21... is the actual length of UDL

-Put hex here

https://codebeautify.org/hex-string-converter


Finally decoded done successfully!!!

do not forget >>> like & comment 



Have a sweet day 

































decode SMS-SUBMIT




0001AB0B915121551532F400C80F3190BB7C07D9DFE971B91D4EB301


Data coding : SMS Default Alphabet


00 : SMSC ( use cell phone default )

01 : PDU Type

-00000001 : 01 >>> SMS-SUBMIT

--bit0,1:01 MTI message type indicator

--bit2 : 0 RD reject duplicate

--bit3,4 : 00 VPF not presented

--bit5 : 0 SRR status not requested

--bit6 : 0 UDHI not presented

--bit7 : 0 RP reply path

Decimal =10×16+11=171
AB : MR ( Message refrence ) hex value

DA : 0B915121551532F4

Destination address

--0B : Length hex value

decimal=0×16+11=11

International number : 91(+)

number : 5121551532F4

51 21 55 15 32 F4 ( remove F )

decode : 15125551234

finally >>> +15125551234

00 : PID

C8 : DCS 

--Coding Group: Message Waiting Info: Discard Message

C8  : Voicemail Active
C9  : Fax Active
CA  : E-mail Active

0F : UDL

3190BB7C07D9DFE971B91D4EB301 : UD


decoding User Data :

-Reverse hex

01B34E1DB971E9DFD9077CBB9031

-Change to bunary

00000001 10110011  01001110

00011101 10111001 01110001

11101001 11011111 11011001

00000111 01111100 10111011

10010000 00110001

-How many zeros to be remove from the left?

14×814×(8÷7)×7=0 ( means nothing )


--convert 7bits 7bits to hex value


0000000:00

1101100:6C

1101001:69

1100001:61

1101101:6D

1100101:65

1100011:63

1101001:69

1101111:6F

1110110:76

0100000:20

1110111:77

1100101:65

1101110:6E

0100000:20

0110001:31


-Reverse hex

31206E657720766F6963656D61696C00

-Hex to string ( Copy here )

https://codebeautify.org/hex-string-converter




finally decoded done successfully.
































decode SMS-SUBMIT



Read following  first : 

SMS-SUBMIT
Bit:
0,1-MTI (00 : Deliver , 01 Submit )
2-RD ( Reject Duplicate )
3,4-VPF
0 0 VP field is not present
0 1 Reserved
1 0 VP field present an integer represented (relative)
1 1 VP field present an semi-octet represented (absolute)
5-SRR (Status report request)
0:A status report is not requested
1:A status report is requested
6-UDHI
When TP-UDHI has value 1, the TP-UD field starts with User Data Header
7-RP

0:Reply Path parameter is not set in this PDU
1:Reply Path parameter is set in this PDU




SMS-SUBMIT :
000100
0B915892214365F7000021493A283D0795C3F33C88FE06CDCB6E32885EC6D341EDF27C1E3E97E72E


-SMSC Defualt in cell phone : 00

-PDU TYPE : 01

00000001

Starting from right  :

bit0,1 : 01 >>> SMS-SUBMIT

bit2 : 0 >>> RD ( Reject duplicate)

bit3,4 : 00 >>> VP (Valudity period)

if 00 means not present

bit5: 0 >>> SRR (Status report requested) if 1 report requested

bit6: 0 >>> UDHI (User data header indicator) ... use for cancatenated message if 1 means header is present like 05 00 03 CC 02 01 (total02/number01)

bit7: 0 >>> RP ( Reply path ) 

-MR : 00 ( Message refrence by SMSC )

-DA : 0B915892214365F7

DA Len : 0B (Destination address Length)

International code : 91 : Display (+)

Number : 58 92 21 43 65 F7

reverse number from begining as 2 digits

58>>>85

So >>>> 85291234567

---From : +85291234567

-PID : 00

-DCS : 00 (Alphabet) (Dada scheme coding)

if Unicode >>> 08

-UD : 21493A283D0795C3F33C88FE06CDCB6E32885EC6D341EDF27C1E3E97E72E

UDL : 21 in hex value (User data length)

UD : 493A283D0795C3F33C88FE06CDCB6E32885EC6D341EDF27C1E3E97E72E


decoding Data : 

-Reverse Hex value


2EE7973E1E7CF2ED41D3C65E88326ECBCD06FE883CF3C395073D283A49


-Hex to binary

00101110 11100111 10010111 00111110

00011110 01111100 11110010 11101101

01000001 11010011 11000110 01011110

10001000 00110010 01101110 11001011

11001101 00000110 11111110 10001000

00111100 11110011 11000011 10010101

00000111 00111101 00101000 00111010

01001001


Change octet to septet

--Get the number of zeros to be remove.

29×833×7=1

29×8-int(29×8/7)×7=1


-Remove 1 Zero from the left of first above binary ( octet : 00101110 )  and convert 7bits 7bits to hex value like as follows : 



0101110:2E

1110011:73

1100101:65

1100111:67

1100001:61

1110011:73

1110011:73

1100101:65

1101101:6D

0100000:20

1110100:74

1111000:78

1100101:65

1110100:74

0100000:20

1100100:64

1101110:6E

1100101:65

1110011:73

0100000:20

1101111:6F

1110100:74

0100000:20

1111001:79

1110011:73

1100001:61

1100101:65

0100000:20

1110011:73

1101001:69

0100000:20

1110100:74

1001001:49


-Binary to Hex and reverse

4974206973206561737920746F207365

6E642074657874206D65737361676573

2E

-Hex to text convertor : 

https://codebeautify.org/hex-string-converter



finally decoded done successfully !!!



Please do not hesitate to forget >>> Like and Comment






















SMS-SUBMIT



-Decode UD(User data) in 7bit (Sending max 160 char)-(Ascii 140 Char Max Len)


below Text(fingilish)  to Hex


4d616e206d6f6469726520696e206d616a6d6f6f652068617374616d206c6f7466616e2062612062616e64652068616d6168616e672062617368696420676f6c616e616d2e


Length : 69 (2digits)-change to hex value

Hex : 69÷16=4 & 69-4×15=5 : 45

So UDL(User data length)=45 


Hex to binary  : 

2E=2×16+14=46(decimal)

46÷2=23 Reminder=0

23÷2=11 Reminder=1

11÷2=5    Reminder=1

5÷2=2     Reminder=1

2÷2=1        Reminder=0

1÷2=0   Reminder=1

0÷2=0 Reminder=0


From Down to up :


hex(2E):decimal(46):binary(0101110)




Reverse Hex : 

2E6D616E616C6F672064696873616220676E6168616D61682065646E6162206162206E6166746F6C206D617473616820656F6F6D6A616D206E6920657269646F6D206E614D



2E : octet(00101110)>>>septet(01011110)[Len 7 from the right]


0101110 1101101 1100001 1101110 1100001 1101100  1101111 1100111 0100000 1100100 1101001 1101000 1110011 1100001 1100010 0100000 1100111 1101110 1100001 1101000 1100001 1101101 1100001 1101000 0100000 1100101 1100100 1101110 1100001 1100010 0100000 1100001 1100010 0100000 1101110 1100001 1100110 1110100 1101111 1101100 0100000 1101101 1100001 1110100 1110011 1100001 1101000 0100000 1100101 1101111 1101111 1101101 1101010 1100001 1101101 0100000 1101110 1101001 0100000 1100101 1110010 1101001 1100100 1101111 1101101 0100000 1101110 1100001 1001101



Add the required zero from the left until it is devided by 8 : 

69×7+x Mod 8=0

7bit > 8bit

int(69×7/8)+1=61×8-69×7=5



00000 0101110 1101101 1100001 1101110 1100001 1101100  1101111 1100111 0100000 1100100 1101001 1101000 1110011 1100001 1100010 0100000 1100111 1101110 1100001 1101000 1100001 1101101 1100001 1101000 0100000 1100101 1100100 1101110 1100001 1100010 0100000 1100001 1100010 0100000 1101110 1100001 1100110 1110100 1101111 1101100 0100000 1101101 1100001 1110100 1110011 1100001 1101000 0100000 1100101 1101111 1101111 1101101 1101010 1100001 1101101 0100000 1101110 1101001 0100000 1100101 1110010 1101001 1100100 1101111 1101101 0100000 1101110 1100001 1001101


Seperate 8digits (octet) : 


00000010111011011011100001110111

01100001110110011011111100111010

00001100100110100111010001110011

11000011100010010000011001111101

11011000011101000110000111011011

10000111010000100000110010111001

00110111011000011100010010000011

00001110001001000001101110110000

11100110111010011011111101100010

00001101101110000111101001110011

11000011101000010000011001011101

11111011111101101110101011000011

10110101000001101110110100101000

00110010111100101101001110010011

01111110110101000001101110110000

11001101


تبدیل باینری های بالا  طبق جدول به Hex : 


02 ED B8 77 61 D9 BF 3A 0C 9A 74 73 C3 89 06 7D D8 74 61 DB 87 42 0C B9 37 61 C4 83 0E 24 1B B0 E6 E9 BF 62 0D B8 7A 73 C3 A1 06 5D FB F6 EA C3 B5 06 ED 28 32 F2 D3 93 7E D4 1B B0 CD



برعکس کردن مقادیر Hex : 


CDB01BD47E93D3F23228ED06B5C3EA

F6FB5D06A1C3737AB80D62BFE9E6B0

1B240E83C46137B90C4287DB6174D8

7D0689C373749A0C3ABFD96177B8ED

02


00110008810100358500000C45CDB01BD47E93D3F23228ED06B5C3EAF6FB5D06A1C3737AB80D62BFE9E6B01B240E83C46137B90C4287DB6174D87D0689C373749A0C3ABFD96177B8ED02

UDL(User data length)=45hex=69




Address Example  : 


Alphanumeric address is at first put to the GSM 7-bit default alphabet, then encoded the same way as any message text in TP-UD field (that means it is 7-bit packed) and then the address is supplied with the "number" length and TON and NPI.

For example, a fictional alphanumeric address Design@Home is converted to the GSM 7-bit default alphabet which yields 11 bytes 44 65 73 69 67 6E 00 48 6F 6D 65 (hex), the 7-bit packing transforms it to 77 bits stored in 10 octets as C4 F2 3C 7D 76 03 90 EF 76 19; 77 bits is 20 nibbles (14 hex) which is the value of the first octet of the address. The second octet contains TON (5) and NPI (0), which yields D0 hex. The complete address in the GSM format is 14 D0 C4 F2 3C 7D 76 03 90 EF 76 19.

-Text to Hex Value : Design@Home

44657369676e40486f6d65

Length : 11

-Reverse Hex Values

65 6D 6F 48 40 6E 67 69 73 65 44

-Binary ( 7 bit from the right )

1100101 1101101 1101111 1001000

1000000 1101110 1100111 1101001

1110011 1100101 1000100

-Add required zero to the left : 

int(11×7/8)+1=10×8-11×7=80-77=3

000 1100101 1101101 1101111 

1001000 1000000 1101110 1100111 

1101001 1110011 1100101 1000100

-Octet :

00011001011101101110111110010001

000000110111011001111101

001111001111001011000100

-Binary to Hex :

19 76 EF 91 03 76 7D 3C F2 C4

-Reverse Hex : 

C4 F2 3C 7D 76 03 91 EF 76 19


80÷4=20>>>hex(14)


The format of addresses in the GSM 03.40 is described in the following table:

octetMeaning
0address length in nibbles (semi-octets)
1EXT, TON, NPI
2-11address digits

the nibble is often called a semi-octet


-Ext : usaually 1

-TON ( Type of number )

bit 6,5,4 :

unknown 000

international number : 001

National number : 010

Network specific number : 011

Subscriber number  100

Alphanumeric, (coded according to 3GPP TS 23.038 [9] GSM 7-bit default alphabet)  101

Abbreviated number 110

Reserved for extension 111


-NPI ( Numbering plan id )

bit 3,2,1,0

Unknown 0000

ISDN/telephone numbering plan (E.164/E.163) 0001

Data numbering plan (X.121) 0011

Telex numbering plan 0100

Service Centre Specific plan 0101

Service Centre Specific plan 2) 0110

National numbering plan 1000

Private numbering plan 1001

ERMES numbering plan (ETSI DE/PS 3 01 3) 1010

Reserved for extension 1111



EXT : 1 , TON : 001 , NPI : 0001 :

10010001 >>>>  Hex : 91

EXT : 1 , TON : 000 , NPI : 0001 :

10000001 >>>> Hex : 81


1 010 1000 : A8


00110008A8010035850008051006450647080006650666


1 001 1001 : 99


0011000A9989010035850008051006450647080006650666






002414
D0C4F23C7D760390EF76190000111011315214000BE474D81C0EBB5DE3771B


-TP-DCS : 


Message Classes
ValueMessage Class
0 00 - Flash messages
0 11 - ME-specific
1 02 - SIM / USIM specific
1 13 - TE-specific

Flash messages are received by a mobile phone even though it has full memory. They are not stored in the phone, they just displayed on the phone display.


Coding Group : General Data Coding


00  0   GSM 7 bit Default
08  8   UCS2        Default
10 16 GSM 7 bit  Class 0 (Flash message)
14 20 8 bit data Class 0 (Flash message)
18 24 UCS2 Class 0 (Flash message)
20 32 GSM 7 bit   Default  +(compressed)
30 48 GSM 7 bit  Class 0 (Flash message) +(compressed)

Message Marked for Automatic Deletion :
40 64 GSM 7 bit Default
44 68 8 bit data Default
48 72 UCS2       Default

48 : Hex , 72 : decimal

50 80 GSM 7 bit Class 0 (Flash message)
60 96 GSM 7 bit Default  +(compressed)
54 84 8 bit data Class 0 (Flash message)
60 96 GSM 7 bit Default  +(compressed)
70 112 GSM 7 bit Class 0 (Flash message) +(compressed)


0031000B9189199370489400480036062F06310020062D062706440020062A0633062A0020062706310633062706440020067E06CC0627064506A9002006470633062A0645

UDL:decimal(54),Hex(36)

062F : د

Length from 0B to the end : 66





























SMS in Alphabet mode



SMS DELIVER:
SCA-PDU TYPE-OA-PID-DCS-SCTS-UDL-UD
SMS-SUBMIT:
SCA-PDU TYPE-MR-DA-PID-DCS-VP-UDL-UD




Mode Alphabet : 160  Character in part 1 ( Ascii 140,binary septet 160 )

Text : Salam

1-Ascii text to Hexadecimal

53 61 6C 61 6D

?H53

2-Decimal to binary




83÷2=41 Reminder 1

41÷2=20 Reminder 1

20÷2=10 Reminder 0

10÷2=5 Reminder 0

5÷2=2 Reminder 1

2÷2=1 Reminder 0

1÷2=0 Reminder 1

Hex53Decimal83=1010011

Hex61Decimal97=1100001

Hex6CDecimal108=1101100

Hex61Decimal97=1100001

Hex6DDecimal109=1101101



3-Change 8 bit to 7 bit  : 10001100>0001100

Seperate 7 digits from Right 

4-Reverse Binary from last hex to the first

1101101 1100001 1101100 1100001 1010011

5-how many 0 reqired?  5×(7+1)-5×7=5

Add 5 Zero to the left 

00000 1101101 1100001 1101100 1100001 1010011

6-Change binary  to hex



0000011011011100001110110011000011010011


0110=0×2^(3)+1×2^(2)+1×2^(1)+0×2^(0)=6


0D33D3






7-Reverse Hex

D3303BDC06



SMS SUBMIT

00311E08810100353800000A05D3303BDC06


MR(Message refrence)=hex(1E):decimal(30)

DCS(Data coding scheme):00

Validity : 0A

UDL(User data length) : 05

UD (User data) : D3303BDC06




Packed




0110001 0110010 0110011 0110100 0110101 0110110 0110111 0111000

Reverse binary:

0111000 0110111 0110110 0110101 01101000110011 0110010 0110001

Add Zero to the first 8×(7+1)-8×7=8

000000000111000 0110111 0110110 0110101 01101000110011 0110010 0110001

Seperate 8 digits 8 digits :

00000000 : 00

01110000 : 70

11011101 : DD

10110011 : B3

01010110 : 56

10001100 : 8C

11011001 : D9

00110001 : 31

Reverse Hex : 

31 D9 8C 56 B3 DD 70 00


0031000881010035850000000831D98C56B3DD7000

Message : 12345678






-Hex

Hex Len:16

54 61 73 68 20 4D 65 6E 65 20 53 69 6C 65 73 68

-Septet

1010100 1100001 1110011 1101000 0100000 

1001101 1100101 1101110 1100101 0100000

1010011 1101001 1101100 1100101 1110011

1101000

-Reverse binary

1101000 1110011 1100101 1101100 1101001

1010011 0100000 1100101 1101110 1100101

1001101 0100000 1101000 1110011 1100001

1010100

-16×(7+1)-16×7=16

-Required Zero at the first =16

8 digits separation

00000000: 00

00000000:00

11010001:D1

11001111:CF

00101110:2E

11001101:CD

00110100:34

11010000:D0

01100101:65

11011101:DD

10010110:96

01101010:6A

00001101:0D

00011100:1C

11110000:F0

11010100:D4

-Revers Hex

D4 F0 1C 0D 6A 96 DD 65 D0 34 CD 2E CF D1 00 00


00310008810100358500000B10D4F01C0D6A96DD65D034CD2ECFD10000

UDL=16(decimal)=10(Hex)

UD=D4F01C0D6A96DD65D034CD2ECFD10000



SCA

Service Center Address information element

Telephone number of the Service Center

PDU Type

Protocol Data Unit

Type

 

MR

Message Reference

successive number (O. .255) of all SMS-SUBMIT Frames set by the MOBILE

OA

Originator Address

Address of the originating SME

DA

Destination Address

Address of the destination SME

PID

Protocol Identifier

Parameter showing the SMSC how to process the SM (as FAX, Voice etc)

DCS

Data Coding Scheme

Parameter identifying the coding scheme within the User Data (UD)

SCTS

Service Center Time Stamp

Parameter identifying time when the SMSC received the message

VP

Validity Period

Parameter identifying the time from where the message is no longer valid in the SMSC

UDL

User Data Length

Parameter indicating the length of the UD-field

UD

User Data

Data of the SM

RP

Reply Path

Parameter indicating that Reply Path exists

UDHI

User Data Header Indicator

Parameter indicating that the UD field contains a header

SRI

Status Report Indication

Parameter indicating if the SME has requested a status report

SRR

Status Report Request

Parameter indicating if the MS has requested a status report

VPF

Validity Period Format

Parameter indicating whether or not the VP field is present

MMS

More Messages to Send

Parameter indicating whether or not there are more messages to send

RD

Reject Duplicate

 

MTI

Message

Type

Indicator

Parameter describing the message type

00 means SMS-DELIVER

01 means SMS-SUBMIT




TPDU Types
TP-MTIdirectionmessage type
0 0MS → SCSMS-DELIVER-REPORT
0 0SC → MSSMS-DELIVER
0 1MS → SCSMS-SUBMIT
0 1SC → MSSMS-SUBMIT-REPORT
1 0MS → SCSMS-COMMAND
1 0SC → MSSMS-STATUS-REPORT
1 1anyReserved


SMS-DELIVER is used to deliver a message from SMSC to a mobile phone.


Bit fields in the first octet of SM-TL TPDU
bit(s)Meaning
1-0TP-Message-Type-Indicator (TP-MTI)
2TP-More-Messages-to-Send (TP-MMS) in SMS-DELIVER (0 = more messages)
2TP-Reject-Duplicates (TP-RD) in SMS-SUBMIT
3TP-Loop-Prevention (TP-LP) in SMS-DELIVER and SMS-STATUS-REPORT
4-3TP-Validity-Period-Format (TP-VPF) in SMS-SUBMIT (00 = not present)
5TP-Status-Report-Indication (TP-SRI) in SMS-DELIVER
5TP-Status-Report-Request (TP-SRR) in SMS-SUBMIT and SMS-COMMAND
5TP-Status-Report-Qualifier (TP-SRQ) in SMS-STATUS-REPORT
6TP-User-Data-Header-Indicator (TP-UDHI)
7TP-Reply-Path (TP-RP) in SMS-DELIVER and SMS-SUBMIT


According to above table ( PDU Type ) :  

Submit : MTI-RD-VPF-SRR-UDHI-RP

Deliver : MTI-MMS-LP-SRI-UDHI-RP



TP-SRI(only set by SMSC) :

0: a status report will not be returned to the SME

1: a status report will  be returned to the SME






00400881010035850008322131313121000B050003CC020106450648

SMS-SUBMIT
Bit:
0,1-MTI (00 : Deliver , 01 Submit )
2-RD ( Reject Duplicate )
3,4-VPF
0 0 VP field is not present
0 1 Reserved
1 0 VP field present an integer represented (relative)
1 1 VP field present an semi-octet represented (absolute)
5-SRR (Status report request)
0:A status report is not requested
1:A status report is requested
6-UDHI
When TP-UDHI has value 1, the TP-UD field starts with User Data Header
7-RP
0:Reply Path parameter is not set in this PDU
1:Reply Path parameter is set in this PDU

11=00010001

31=00110001

61=01100001


006100088101003585000809050003CC02010645
PDU  61 : 01100001
From the rightest digit : 
bit0,1:MTI:01:SMS-SUBMIT
bit 2:RD:0
bit 3,4:VP:00 Not Present
bit 5:SRR:1:report requested
bit6:UDHI:1:Present:050003CC0201
bit7:RP:0


0031000881010035850008BB020645
PDU 31 : 00110001
MTI : 01 : SMS-SUBMIT
-Different with PDU 61
From the rightest digit ( See Bold )
VP : 10 : Present : BB(21 Day validity)
UDHI : 0 : Not Present


0021000881010053850008020645
PDU  21 : 00100001
bit0,1 : 01 : MTI : SMS-SUBMIT
bit 5 : 1 : SRR : status report request
VP : not present
UDHI : not present

0025000881010035850008020645
SMSC:00 >Using Sms center number from cell phone
MR : Message refrence (Hex value) : 00
Usaully originated from SMSC and no need changing it from 00 to another
TO : 10005358 : 01003558
iff Odd Number then Add F to the last then reverse 2-digits from the left
PDU 25 : 00100101
bit0,1 : 01 : SMS-SUBMIT
bit2 : 1 : RD : Reject duplicate
bit3,4 : 00 : VP : not present
bit5 : 1 : SRR : status report requested
bit6 : 0 : UDHI : not present ( use in concatenated message : multi part )
bit 7 : 0 : RP : not present

00F5000881010035850008CC09050003BB04010645
VP:CC:84days
Data header:050003BB0401
UDL:09
UD:050003BB04010645
text: م
SMSC:00 (Use default center in cell)
PDU F5 : 11110101
bit0,1 : MTI : 01 : SMS-SUBMIT
bit2 : RD : 1
bit3,4 : VP : 10 : validity present
bit5 : SRR : 1 : status report requested
bit6 : UDHI : 1 : present ( Concatenated Message )
bit7 : RP : 1 :  present




there are 40, 44, and 60, there are additional header fields because it is a concatenated SMS. This means that the SMS is divided into parts and sent in segments, and then the modem/phone reassembles them. And there are headers for collecting the SMS parts




0021000881010035850008020645

SMS-SUBMIT:
SCA-PDU TYPE-MR-DA-PID-DCS-VP-UDL-UD

PDU TYPE

21=00100001






AT COMMAND : 

Sending in text mode

AT

>ATOK

AT+CMGF=1[ENTER]
Enter the destination phone number
AT+CMGS=”+61419879619”[ENTER]
Enter the text message and terminate it with “CTRL Z”
>hello[CTRL Z]




Baud Rate:19200 : bps
Data Bits : 8
Stop Bits : 1
Parity N : None

AT+CMGS=18 (actual pdu length)
>0011000A814091786991000001
05E8329BFD06[CTRL Z]

+CMGS: 12

OK 

To : 0419879619

Message : hello

PDU type : SMS-SUBMIT (11)

Refrence : 0 (00)

Validity : 10 minutes (01)

Data coding : SMS Default Alphabet

UDL : 05

UD : E8329BFD06



+CMGF: 0
OK
SMS message for is configured for PDU mode
Checking SMS Mode…
AT+CMGS=48

0011000881010035850000aa28D3E614D42CCFE7E17319342FBBE920B3FCDD0605A9A0E1BBDD0EBBC9206A794E2FCB5D


+CMGS: 23

OK


UDL:28

message : SMS Message sent from AT Command Tester.

Hex Value of message : 

534d53204d6573736167652073656e742066726f6d20415420436f6d6d616e64205465737465722e

Length : 40 (2digits)

UDL in alphabet mode is the length of septet before encoding to octet.

40decimal=28hex

40÷2=2 40-2×16=8 so 28



AT COMMAND : READ 


AT+CMGR=1 [ENTER]

+CMGR: 0,,24

07911614786007F0040B911604994743F400009930139100406B05E8329BFD06

OK










برای دفع سنگ کلیه  خربزه را تمیز شسته و با پوست و گوشت و تخم داخل مخلوط کن بریزید تا کامل میکس شود و روزی 2تا ۳ لیوان میل کنید .

 















SMSPDU-DELIVER


069189190150132006918908080008712042518192818406280633062A064700200627064A0646062A06310646062A0033003000200631064806320647060C00200032002B0032002006AF064A06AF062706280627064A062A00200647062F064A06470020063406280627064606470020062A06270020063306270639062A002000320030003A00340039003A003200310020062A06270631064A



***06918919015013

06>>>Length (91/89/19/01/50/13)  91=1 Len

91>>>+

8919015013>>>9891100531


***200691890808000871204251819281

TP-DCS : Data Coding Scheme (08)

TP-SCTS : Time Stamp

712042518192>>>YYMMDD:170224

518192>>>HHMMSS:151829

TP-UDL(User Data Length) & TP-UD

***8406280633062A064700200627064A0646062A06310646062A0033003000200631064806320647060C00200032002B0032002006AF064A06AF062706280627064A062A00200647062F064A06470020063406280627064606470020062A06270020063306270639062A002000320030003A00340039003A003200310020062A06270631064A

0628 has 2 Length :06/28

User Data Length : 

132 Decimal to Hex ?!!!

132>>>132\16 & 132  Mod 16>>>84



Concatenated SMS

in every part 70 Characer including space

05 00 03 CC 03 01

05 00 03 CC 03 02

05 00 03 CC 03 03


Field1: Length of UDH

Field2: IEI (information Element Identifier)-1 octet

Field3: IEL(information Element Length)-1 octet

Length Excluding IEI

Field4 : Unique Refrence number For All Parts-1 octet

From 00 to FF   ( 00-FF )

Field5 : Total number of parts-1 octer

00-FF ... Not Be Zero

Field6 : this part's number in sequence-1 octet

Start from 1 To 






Sending Message : ( Single Part )


PDU
07912160130300F411000A8158888700890000aa27D3E614D42CCEE7E17319342FBBE920B3FCDD0605A9A0E1BBDD0EBBC9206A794E2FCB01


SCA(Service Center Address)07912160130300F4
length 07
Address type 91
Service center address 2160130300F4

PDU-TYPE11

MR (Message ID) 00
DA (Destination Address) : 0A815888870089

Lenght of the address : 10>>>0A

Address Type : 81

Destination phone number: 5888870089
PID (Protocol ID) : 00
DCS (Data Coding Scheme) : 00
VP(Validity Period ) : aa
UDL (User Data Length) :  39 >>> 27
(User Data) :
D3E614D42CCEE7E17319342FBBE920B3FCDD0605A9A0E1BBDD0EBBC9206A794E2FCB01




another Ex. Submit-SMS

Message Split into two part

just part 1 :

007100098121436587F90008008C050003000201063306440627064500200639064406CC0020062D06270644062A002006860637064806310647002006450646002006270644062706460020062F06310020062C064406330647002006470633062A06450020064800200646064506CC0020062A06480646064500200635062D0628062A002006A9064606450020063406280020063306270639

Split Message >>>> 05 00 03 00 02 01

Data Coding Scheme >>> 08 ( UCS )  Like Persian format




00310D0881010035850008011E0645064606380645002006280627063400200641063106320646062F0645


Status Report : 31

MR ( Message Refren e ) : 0D

UDL ( User Data Length ) : 16 >>> Hex=10

UD ( User Data ) : 0645064606380645002006280627063400200641063106320646062F0645




User Data Header (UDH) is a binary structure which may be present at the start of a short message in the Short Message Service in GSM. It does not contain any text, but it specifies how the message should be formatted and processed.

UDH can be used to form Concatenated SMS





SMS (Short Message Service) can contain up to 160 characters, using the 7-bits GSM default alphabet or 140 characters for an 8 bit alphabet or 70 characters for a 16 bit UCS-2 alphabet.



MultiPart SMS : Submit-SMS


----- PDU---1/7 ------

0071000881010035850008058C050003000701062F0631002006AF0648063406CC200C0647062706CC00200633063106CC002006AF064406A9063306CC002006330627064506330648064606AF0020062706320020062C064506440647002006330627064506330648064606AF002006AF064406A9063306CC0020006100350030002006480020006100350031002006280647002006470645

08(Length)-81-10005358>>>088101003585

User Data Length (UDL) : Decimal=140>>>Hex=8C

UDH ( User Data Header ) : 050003000701

05 Length 00 03 00 Refrence 07 Total 01 Number

Length: 152

----- PDU---2/7 ------

0071000881010035850008058C050003000702063106270647002006AF0648063406CC200C0647062706CC00200645062D0628064806280020062F06CC06AF063106CC002006470645068606480646002006AF064406A9063306CC002000610032003100200645063406A906440020062A0628062F06CC064400200073006D00730020062806470020006D006D0073002006280647200C0635

Length: 152

----- PDU---3/7 ------

0071000881010035850008058C05000300070306480631062A0020062E0648062F06A906270631002006CC06A900200645063406A9064400200628063306CC0627063100200631062706CC062C0020064800200622063206270631062F06470646062F0647002006270633062A002E00200645063906450648064406270020062806270020062706410632062706CC06340020062A0639062F

Length: 152

----- PDU---4/7 ------

0071000881010035850008058C0500030007040627062F002006A906270631062706A9062A06310020062706330020062706450020062706330020062F0631002006330627064506330648064606AF00200028064506390645064806440627064B0020003300300030002006A906270631062706A9062A06310029002006280647200C063506480631062A0020067E06CC0634200C06410631

Length: 152

----- PDU---5/7 ------

0071000881010035850008058C050003000705063600200073006D0073002006CC06270020067E06CC0627064506A900200645062A064606CC0020062806470020067E06CC06270645002006860646062F002006310633062706460647200C062706CC002006CC06270020006D006D00730020062A0628062F06CC06440020064506CC200C06340648062F002E0020062A0628062F06CC0644

Length: 152

----- PDU---6/7 ------

0071000881010035850008058C0500030007060020067E06CC0627064500200645062A064606CC0020062806470020067E06CC06270645002006860646062F0020063106330627064606470020062706CC0020062A062C063106280647002006460627062E06480634062706CC0646062F06CC002006270633062A002006A9064700200647064606AF06270645002006270631063306270644

Length: 152

----- PDU---7/7 ------

007100088101003585000805740500030007070020067E06CC0627064506A900200637064806440627064606CC0020062F0631002006330627064506330648064606AF00200648002006AF0648063406CC200C0647062706CC002006270646062F0631064806CC062F06CC00200631062E0020064506CC200C062F0647062F002E

Length: 128





SMS-SUBMIT

Message To : 10005358

00710E088101003585001A000E050003CC07010645064606380645



Bit fields in the first octet of SM-TL TPDU
bit(s)Meaning
1-0TP-Message-Type-Indicator (TP-MTI)
2TP-More-Messages-to-Send (TP-MMS) in SMS-DELIVER (0 = more messages)
2TP-Reject-Duplicates (TP-RD) in SMS-SUBMIT
3TP-Loop-Prevention (TP-LP) in SMS-DELIVER and SMS-STATUS-REPORT
4-3TP-Validity-Period-Format (TP-VPF) in SMS-SUBMIT (00 = not present)
5TP-Status-Report-Indication (TP-SRI) in SMS-DELIVER
5TP-Status-Report-Request (TP-SRR) in SMS-SUBMIT and SMS-COMMAND
5TP-Status-Report-Qualifier (TP-SRQ) in SMS-STATUS-REPORT
6TP-User-Data-Header-Indicator (TP-UDHI)
7TP-Reply-Path (TP-RP) in SMS-DELIVER and SMS-SUBMIT



004008810100358500083231213121530016050003CC030106450646063806450200062806270634

DeliveyDate/Time :

323121312153>>>2023/12/13 13:12:35

TP-UDL : Decimal:22>>>Hex:16

TP-UDH : 050003CC0301




















الگوریتم لان ( Luhn algorithm )





الگوریتم لان یا فرمول لان، که به الگوریتم "پیمانه ۱۰" نیز مشهور است، یک فرمول ساده برای درستی یابی تعداد زیادی شماره شناسایی است، مانند شماره کارت‌های اعتباری، شماره‌های IMEI و شماره ملی.



در محاسبات یک Payload ظرفیت حمل یک بسته یا سایر واحدانتقال داده است


شرح برای شماره ای که حاوی Check digit نباشد : 

-شماره شامل 10 رقم 

--اولین رقم سمت راست را در نظر می گیریم و آنرا دوبل می کنیم مثلا اگر رقم سمت راست یک باشد عدد دوم میشود دو

--عدد یک و دو ( و به ترتیب تکرار می کنیم ) را زیر رقم های سمت چپ قرار می دهیم و در هم ضرب می کنیم 

--عدد حاصل از ضرب هر رقم ( در یک یا ۲ ) اگر دو رقمی شد ، آن عدد دو رقمی حاصله را رقم اول و دومش را با هم جمع می کنیم

--اعداد بدست آمده را باهم جمع می کنیم

--از فرمول زیر برای Check digit استفاده می کنیم 

10-(s mOod 10)


Example :

7992739871


1->>>> 1

2>>>> 1×2=2

3>>>>

7x1=7

9×2=18 >>>> 1+8=9

9×1=9

2×2=4

7×1=7

3×2=6

9×1=9

8×2=16 >>>> 1+6=7

7×1=7

1×2=2


s=Sum(7+9+9+4+7+6+9+7+7+2)=67

10-(67 mod 10)=3

67÷10=6.7>>67-(6×10)=67-60=3


final >>>> 79927398713












حوادث روزگار نامروت : 


محسن فوق‌لیسانس حسابداری داشت و یک تاجر بین‌المللی و پولدار بود. همه‌‌چیز در زندگی او به خوبی پیش می‌رفت تا اینکه شریکش سر او را کلاه گذاشت و اموالش را تصاحب کرد. محسن ماند با کلی بدهی؛ او در فضای مجازی از 10 پزشک به‌صورت آنلاین مشورت گرفت تا با شیوه بیهوشی از زنان سرقت کند. او که سال‌ها قبل مقام قهرمانی شطرنج کشور و کیک بوکسینگ را کسب کرده بود حالا تبدیل به یک سارق حرفه‌ای شده است.

چون ورشکست شدم. شریکم سرم را کلاه گذاشت و از کشور فرار کرد. مرا اینجوری نگاه نکنید، زمانی برای خودم برو و بیایی داشتم؛ مدام سفر خارجی می‌رفتم و زندگی‌ام لاکچری بود اما شریکم که از چشمانم بیشتر به او اعتماد داشتم زندگی‌ام را با خودش برد و کاری در حقم کرد که تبدیل به یک ورشکسته و بعد سارق حرفه‌ای شدم.







ISO 8583 ( تبادل پیام تراکنش مالی )


ISO 8583 یک استاندارد بین المللی برای کارت تراکنش مالی  منشا پیام های تبادلی است


-فرمت پیام 

--نشانگر نوع پیام یا MTI

از ۴ رقم تشکیل شده ، رقم اول نسخه ، رقم دوم هدف کلی پیام ، رقم سوم چگونگی جریان در سیستم و رقم چهارم  مکان منبه پیام در زنجیره پرداخت را مشخص می کند


مثال : برای 0110

رقم اول از سمت چپ : نسخه 1987
رقم دوم از سمت چپ : کلاس پیام ( یک برابر پیام مجوز)
رقم سوم از سمت چپ : عملکرد پیام (  یک برابر جواب )
رقم چهارم از سمت چپ : چه کسی ارتباط را آغاز می کند ( صفر برابر خریدار )  
بنابراین ، MTI 0110 یک پیام پاسخ مجوز است که در آن  تراکنش واقعی توسط خریدار انجام شده است.

0*** - ISO 8583:1987
1*** - ISO 8583:1993
2*** - ISO 8583:2003
...


یک بیتمپ کدباینری است در این ایزو که نشان میدهد کدام فیلد  در یک پیام تراکنش مالی  موجودیت دارد . هر بیت بیانگر یک تک فیلد است ، با یک به معنی موجودیت و 0 عدم موجودیت فیلد .
مثال : 
ما فیلدهای زیر را در پیام  ایزو دریافت کردیم
 3, 4, 6, 7, 10, 12, 13, 14, 21, 24, 25, 27, 29, 30, 33, 34, 36, 39, 44, 48, 52, 55, 57, 59, 62,63

 اگر بعنوان باینری بخواهیم ارائه کنیم بصورت زیر می شود : 64 بیت برابر با ۸ بایت از باینری 

 0011 0110 0101 1100 0000 1001 1010 1100 1101 0010 0001 0001 0001 0010 1010 0110


0011 از سمت چپ شروع کنید  00  اول یعنی فیلد اول و دوم وجود ندارند و دو تای بعدی که یک هستند یعنی فیلد سوم و چهارم موجود هستند (فیلد چهارم میشه مبلغ تراکنش)

وقتی بخواهیم چیزی را خواناتر و فشرده تر سازیم ، می توانیم باینری را به صورت 16 بایت از مقدار هگزادسیمال ( Unpacked ) نشان دهیم که به شکل زیر می شود

365C09ACD21112A6

در زیر نشان داده شده که چگونه هگزادسیمال از باینری بدست آمده 

0011 -> 3
0110 -> 6
0101 -> 5
1100 -> C
... etc
مثال دیگر : موجودیت بیت ها 
3,4,7,11,12,13,15,17,32,35,37,41,43,48,
49,60,61,62,63,64,100,102
0011(3) 0010(2) 0011(3) 1010(A) 1000(8) 0000(0) 0000(0) 0001(10010(2) 1000(8) 1010(A) 0001(1) 1000(8) 0000(0) 0001(1) 1111(F)
323A800128A1801F0000000014000000
بصورت ۱۶ کاراکتر هگزادسیمال : 
Primary : 323A800128A1801F
Secondary :0000000014000000

فیلد 49 ( Currency ) برای ایران : کد ۳۶۴

Iran

IRR

364

درجدول ستون Data Field رو ملاحظه کنید که جلوی مقدار 49 ذکر کرده Alpha numeric به طول ۳ کاراکتر ( یعنی می توان یکی از IRR یا کد 364 را وارد کرد.)

----بیتمپ ممکن است به صورت ۸ بایت داده باینری یا بصورت 16 کاراکتر هگزادسیمال ارسال شود.0-9 ، A-F در مجموعه کاراکترهای ASCII یا EBCDIC. یک فیلد تنها زمانی وجود دارد که بیت خاص در بیتمپ درست باشد.به عنوان مثال ، بایت 82x و باینری 1000 0010 و بدین معنی است که  فیلدهای 1 و 7 در پیام موجود است و فیلدهای 2 تا 6 وجود ندارند.

Field 1 : Binary 1000 : Hex 8
Field 64 : Binary 0001 : Hex 1
8000000000000001 (Fields 1, 64)
Field 127,128 :Binary  0011 : Hex 3
0000000000000003
(secondary bitmap) Fields 127, 128


1011001000111000000000000000000000001000100000010000000000010000 .
-Now group it by 4 when it will be like
1011 0010 0011 1000 0000 0000 0000 0000 0000 1000 1000 0001 0000 0000 0001 0000 .
-Get the Hex value of each of the 4 groups.
1011 = B
0010 = 2
0011 = 3
1000 = 8
and so on
-Now put them all together to get the primary bitmap  :
B238000008810010


020012100000000080000000001100000504135520122348IRR
MTI:0200
Primary Bitmap : 1210000000008000
Field 4,7,12,49 are prsent


در ISO 8583 یک Bitmap فیلد یا زیرفیلدهایی درون یک پیام است ، که مشخص می کند سایر عناصر داده یا زیر فیلدهای عنصر داده در جای دیگری از پیام وجود دارند یا خیر.

یک فیلد زمانی وجود دارد که بیت مربوطه در بیتمپ تنظیم شده باشد.بعنوان مثال ، یک هگز با مقدار 0x82 ( دسیمال 130 ) باینری 0010 1000 است.یعنی فیلدهای 1 و 7 در پیام وجود دارند و فیلدهای 6،5،4،3،2 و 8 وجود ندارند.

Bitmap ممکن است بعنوان 8 بایت از داده باینری یا کاراکترهای هگزادسیمال ( A-F , 0-9 ) در کاراکتر اسکی بیان گردد.یک پیام شامل حداقل یک بیتمپ با نام Primary bitmap خواهد بود و نمایانگر اجزاء داده 1 تا 64 موجود است.وجود یک بیتمپ ثانویه اختیاری نیز با بیت اول در بیت مپ اولیه نمایش داده می شود ( یعنی اگر بیت اول یک باشد مثل کد باینری 1000 در اول کدهای باینری Primary با دارا  بودن اولین کاراکتر سمت چپ که  یک است ، نشاندهنده وجود Secondary Bitmap است.  در صورت وجود ، بیتمپ ثانویه نشان می دهد که آیا عناصر داده 65 تا 128 وجود دارند یا خیر .به طور مشابه یک بیتمپ سوم می تواند برای نشان دادن حضور فیلدهای 129 تا 192 استفاده شود ، اگر چه این عناصر به ندرت استفاده می شوند.


مثال : 

مقدار بیتمپ داده شده 

70 10 00 11 02 C0 48 04

هگز 70 برابر 0000 0111 ( شمارش از سمت چپ ، دوم تا چهارمین بیت یک است ، که نشان می دهد فیلد 2 تا 4 موجود هستند.)


هگز 10 برابر باینری 0000 0001 ( اولین بیت متعلق به فیلد 9 است ، همچنین بیت چهارم اینجا نشان می دهد که فیلد 12 موجود است.)


هگز 00 یا باینری 0000 0000 ( هیچ فیلدی موجود نیست )


هگز 11 یا باینری 0001 0001 ( فیلد 28 و 32 موجودند)


هگز 02 یا باینری 0010 0000 ( فیلد 39 موجود است)


هگز C0 یا باینری 0000 1100 ( فیلد 41 و 42 موجودند )



هگز 48 یا باینری 1000 0100 ( فیلد 50 و 53 موجودند)


هگز 04 یا باینری 0100 0000 ( فیلد 62 موجود است )



هگز به دسیمال : 
(70)₁₆ = (7 × 16¹) + (0 × 16⁰) = (112)₁₀
دسیمال به هگز
112÷16=7
112-(7×16)=0
70

هگز 7 به باینری ( دودویی)
7/2=3 , reminder=1
3/2=1 , reminder=1
1/2=0 , reminder=1
So >>> 111 ... 0111
5/2=2 , Reminder=1
2/2=0 , Reminder=0
0/2=0 , reminder=1
So >>> 101 ... 0101
&H57 = 01010111




فیلد 4 حاوی مبلغ تراکنش می باشد، به طور کلی اگر تراکنشی دارای مبلغ باشد، باید مقدار آن را در فیلد شماره 4 با طول ثابت 12 رقم قرار دهد برای مثال 1000 تومن را باید 000000010000 در نظر گرفت.

b 64 منظور تشکیل شده از ۶۴ بیت 
n یعنی فقط  عددی  وقتی dot دارد یعنی تا آن طول
در جدول زیر فیلد 4 ستون Type یعنی  فقط ارقام با طول دوازده کاراکتر
فیلد 7 برای تاریخ و زمان با طول ۱۰ کاراکتر مثل 0504162603 اولی Date و بعدی شامل ساعت دقیقه و ثانیه 
Data fieldTypeUsage
1b 64Bitmap
2n..19Primary account number (PAN)
3n 6Processing Code
4n 12Amount Transaction
5n 12Amount, settlement
6n 12Amount, cardholder billing
7n 10Transmission date & time
8n 8Amount, cardholder billing fee
9n 8Conversion rate, settlement
10n 8Conversion rate, cardholder billing
11n 6System trace audit number (STAN)
12n 6Local transaction time (hhmmss)
13n 4Local transaction date (MMDD)
14n 4Expiration date (YYMM)
15n 4Settlement date
16n 4Currency conversion date
17n 4Capture date
18n 4Merchant type, or merchant category code
19n 3Acquiring institution (country code)
20n 3PAN extended (country code)
21n 3Forwarding institution (country code)
22n 3Point of service entry mode
23n 3Application PAN sequence number
24n 3Function code (ISO 8583:1993), or network international identifier (NII)
25n 2Point of service condition code
26n 2Point of service capture code
27n 1Authorizing identification response length
28x+n 8Amount, transaction fee
29x+n 8Amount, settlement fee
30x+n 8Amount, transaction processing fee
31x+n 8Amount, settlement processing fee
32n ..11Acquiring institution identification code
33n ..11Forwarding institution identification code
34ns ..28Primary account number, extended
35z ..37Track 2 data
36n ...104Track 3 data
37an 12Retrieval reference number
38an 6Authorization identification response
39an 2Response code
40an 3Service restriction code
41ans 8Card acceptor terminal identification
42ans 15Card acceptor identification code
43ans 40Card acceptor name/location (1–23 street address, –36 city, –38 state, 39–40 country)
44an ..25Additional response data
45an ..76Track 1 data
46an ...999Additional data (ISO)
47an ...999Additional data (national)
48an ...999Additional data (private)
49a or n 3Currency code, transaction
50a or n 3Currency code, settlement
51a or n 3Currency code, cardholder billing
52b 64Personal identification number data
53n 16Security related control information
54an ...120Additional amounts
55ans ...999ICC data – EMV having multiple tags
56ans ...999Reserved (ISO)
57ans ...999Reserved (national)
58ans ...999
59ans ...999
60ans ...999Reserved (national) (e.g. settlement request: batch number, advice transactions: original transaction amount, batch upload: original MTI plus original RRN plus original STAN, etc.)
61ans ...999Reserved (private) (e.g. CVV2/service code   transactions)
62ans ...999Reserved (private) (e.g. transactions: invoice number, key exchange transactions: TPK key, etc.)
63ans ...999Reserved (private)
64b 64Message authentication code (MAC)
65b 1Extended bitmap indicator
66n 1Settlement code
67n 2Extended payment code
68n 3Receiving institution country code
69n 3Settlement institution country code
70n 3Network management information code
71n 4Message number
72n 4Last message's number
73n 6Action date (YYMMDD)
74n 10Number of credits
75n 10Credits, reversal number
76n 10Number of debits
77n 10Debits, reversal number
78n 10Transfer number
79n 10Transfer, reversal number
80n 10Number of inquiries
81n 10Number of authorizations (PUTA!)
82n 12Credits, processing fee amount
83n 12Credits, transaction fee amount
84n 12Debits, processing fee amount
85n 12Debits, transaction fee amount
86n 16Total amount of credits
87n 16Credits, reversal amount
88n 16Total amount of debits
89n 16Debits, reversal amount
90n 42Original data elements
91an 1File update code
92an 2File security code
93an 5Response indicator
94an 7Service indicator
95an 42Replacement amounts
96b 64Message security code
97x+n 16Net settlement amount
98ans 25Payee
99n ..11Settlement institution identification code
100n ..11Receiving institution identification code
101ans ..17File name
102ans ..28Account identification 1
103ans ..28Account identification 2
104ans ...100Transaction description
105ans ...999Reserved for ISO use
106ans ...999
107ans ...999
108ans ...999
109ans ...999
110ans ...999
111ans ...999
112ans ...999Reserved for national use
113ans ...999
114ans ...999
115ans ...999
116ans ...999
117ans ...999
118ans ...999
119ans ...999
120ans ...999Reserved for private use
121ans ...999
122ans ...999
123ans ...999
124ans ...999
125ans ...999
126ans ...999
127ans ...999
128b 64Message authentication code (This field belongs to Philipine's Eifle Tower)



00Approved or completed successfully
03Invalid merchant
09Request in progress
12Invalid transaction
13Invalid amount
14Invalid card number (no such number)
19Re-enter transaction
20Invalid response
33Expired card
41Lost card
51Not sufficient funds
54Expired card
57Transaction not permitted to cardholder
58Transaction not permitted to terminal
59Suspected fraud
101expired card
111invalid card number
119transaction not permitted to cardholder
120transaction not permitted to terminal
201expired card


Hex : 080020200000008000000000000000013239313130303031

Table 3. Primary Bitmap
bytehex valuebit valuefield #

0

20

0010 0000

3

1

20

0010 0000

11

2

00

0000 0000

3

00

0000 0000

4

00

0000 0000

5

80

1000 0000

41

6

00

0000 0000

7

00

0000 0000


MTI (0800)
bitmap (2020000000800000)
طبق بالا فیلدهای 3 ، 11 و 41 موجودند بنابراین فیلد بعدی ما شماره 3 است ( اولی MRI دومی BITMAP و سومی ... )



Table 9. Sample authorization request
Fld #DescriptionValueComments

0

MTI

0100

Authorization request

2

Primary Account Number

4321123443211234

3

Processing Code

000000

4

Amount transaction

000000012300

e.g., 123.00

7

Transmission data/time

0304054133

MMYYHHMMSS

11

System trace audit number

001205

14

Expiration date

0205

YYMM

18

Merchant Type

5399

22

POS Entry Mode

022

Swiped Card

25

POS Condition Code

00

35

Track 2

4321123443211234=0205..

37

Retrieval Reference Number

206305000014

41

Terminal ID

29110001

42

Merchant ID

1001001

49

Currency

840












Val(&HE)=Decimal(14) .... Binary (1110)
HEX2BIN:
Dim b As string * 4
b="0000"
جاگذاری از سمت راست
14 Mod 2=0
14\2=7 > 7 Mod 2=1
7\2=3 >  3 Mod 2=1
3\2=1 > 1 Mod 2=1
در نتیجه : 0000 >>>>> 1110 

تبدیل باینری به دسیمال و بعد هگزادسیمال :
Binary(1010)

1×2^(3)+0×2^(2)+1×2^(1)+0×2^(0)=10

Hex(10)=A

Binary(1100)

1×2^(3)+1×2^(2)+0×2^(1)+0×2^(0)=12

Hex(12)=C

Binary(1111)

1×2^(3)+1×2^(2)+1×2^(1)+1×2^(0)=15

Hex(15)=F



هر عنصر داده در قالب استانداردی  توصیف می شود که محتوای  مجاز فیلد ( عددی ، باینری و ... ) و طول فیلد ( متغیر یا ثایت ) را تعریف می کند.

هر فیلد ممکن است دارای طول ثابت یا متغیر باشد.اگر متغیر باشد ، قبل از طول فیل  یک نشانگر طول قرار می گیرد.

TypeMeaning
Fixedno field length used
LLVAR or (..xx)Where 0 < LL < 100, means two leading digits LL specify the field length of field VAR
LLLVAR or (...xxx)Where 0 < LLL < 1000, means three leading digits LLL specify the field length of field VAR
LL and LLL are hex or ASCII. A VAR field can be compressed or ASCII depending on the data element type.LL can be one or two bytes. For example, if compressed as one hex byte, '27x means there are 27 VAR bytes to follow. If ASCII, the two bytes '32x, '37x mean there are 27 bytes to follow. Three-digit field length LLL uses two bytes with a leading '0' nibble if compressed, or three bytes if ASCII. The format of a VAR data element depends on the data element type. If numeric it will be compressed, e.g. 87456 will be represented by three hex bytes '087456x. If ASCII then one byte for each digit or character is used, e.g. '38x, '37x, '34x, '35x, '36x.




00000:00 5B 30 31 31 30 30 30 30 30 30 30 30 38 32 30 80 38 00 00 [.[01100000000820.8..] 
00020:00 81 00 00 04 00 00 00 00 00 00 00 33 36 32 39 31 30 31 30 [............36291010] 
00040:32 39 35 37 31 30 33 31 31 30 30 30 30 30 30 35 30 33 31 53 [2957103110000005031S] 
00060:55 32 30 31 31 31 30 33 31 31 30 32 39 35 37 32 30 31 31 31 [U2011103110295720111] 
00080:30 33 31 31 30 32 39 35 37 33 30 30 31 [0311029573001 ]

5B طول پیام هست و معادل 91 یعنی 11+16×5

1×18+3×20+13=91


بیتمپ اولیه : 

80 38 00 00 00 81 00 00 
فیلدهای 48 ، 41 ،  13 ، 12 ، 11 ، 1 موجود است و فیلد یک یعنی بیتمپ ثانویه نیز موجود است.

بیتمپ ثانویه : 

04 00 00 00 00 00 00 00 
  • فیلد 70 موجود است 

فیلد ۱۱ :   30 31 39 32 36 33   >>>362910
فیلد ۱۲ : 37 35 39 32 39 31  >>> 102957 hhmmss
فیلد ۱۳ :  31 33 30 31  >>> 1031 MMDD
فیلد ۴۱ : 35 30 30 30 30 30 30 31  >>> 10000005
فیلد ۴۸ : 031 
SU20111031102957201110311029573
به فیلد طول 3 رقمی قبل از داده های باقیمانده در این فیلد توجه کنید . که یک فیلد عمومی ( استفاده آینده / خصوصی ) است.
فیلد 70 : 001  مقدار 001 از پیام این نشانه را میدهد که MTI باید 0800 باشد 

Field DefinitionMeaning
n 6Fixed length field of six digits
n.6LVAR numeric field of up to 6 digits in length
a..11LLVAR alpha field of up to 11 characters in length
b...999LLLVAR binary field of up to 999 bytes in length


بررسی پیام ایزو زیر : 

01581200F230040102B000000000000004000000

1048468112122012340000100000001107221800

000001161204171926FABCDE123ABD06414243

000termid1210Community106A5DFGR1112341234234

0158 : طول هدر ( 4 بایت یا ارقام هدر ).نشان می دهد که طول پیام غیر از هدر 158 رقم است . بصورت دو بایت آورده شده.
از خود 1200به طول 4 تا آخرین کاراکترشمارش کنید طول 158 بدست می آید ... 44+38+40+32+4
1200 : نشاندهنده MTI است .
F23 ببعد فیلد یک دارد و نشاندهنده وجود بیتمپ ثانویه چون F را اگر به باینری تبدیل کنید میشود 1111 . از اینجا مشخص می شود که فیلد یک تا 4 موجود است و فیلد یک هم با یک بودنش نمایانگر Secondary Bitmap است.
104846811212 : فیلد دو حاوی شماره حساب اولیه  ( پیشوند هدر نمایانگر طول فیلد 2 یعنی رقم 10 است ) اگر در جدوا فیلدها مشاهده کنید در ستون وسط قید شده n.19 یعنی فیلد فقط numeric یا عددی است و تا 19 عدد را می تواند شامل شود لذا چون طول حساب کمتر از 19 شده لذا طول آن که 10 است قبل آن پیوست شده.
201234 : فیلد سوم  حاوی کد پردازش
000010000000 : فیلد چهارم حاوی  مبلغ تراکنش.اگر در جدول مشاهده کنید فیلد فقط   از نوع numeric یا عددی است با طول 12 و ننوشته تا 12 در نتیجه جای کاراکتر های خالی قبلش تا طول 12 را با صفر پر کرده.
1107221800 : فیلد 7 حاوی  تاریخ و زمان انتقال.
000001 : فیلد 11 حاوی شماره حسابرسی ردیابی سیستم
161204171926 : فیلد 12 حاوی زمان محلی تراکنش
FABCDE123ABD : فیلد 22 کد داده pos
06414243 : فیلد 32 حاوی اخذ شناسایی موسسه    ( پیشوند هدر 06 که نمایانگر طول فیلد 32 است ).طبق جدول فیلد از نوع فقط numeric یا عددی و تا طول 11 را می پذیرد چون در اینجا هدر 6 عدد است لذا طول 6 را در اول آن قرار می دهیم.
000 : فیلد 39 حاوی کد پاسخ.
termid12 : فیلد 41 حاوی شماره شناسایی ترمینال
در جدول ans 8 قید کرده یعنی شامل عدد و حرف و کاراکترهای ویژه . اگر فرضاً عنوان میشد ans .. 8 اگر طول کاراکتر کمتر از 8 میشد می بایست قبل از آن طول قید گردد.
10Community : فیلد 43 حاوی موقعیت داده ( پیشوند هدر نمایانگر طول فیل  43 یعنی رقم 10 است.)
06A5DFGR : فیلد 44 حاوی کد پاسخ اضافی ( پیشوند هدر نمایانگر طول فیلد 32 یعنی رقم 6 است.)
1112341234234 : فیلد 102 حاوی شماره حساب ... این فیل  طبق جدول طولش تا 28 کاراکتر شامل ارقام و حروف و special character است >>>> ans .. 28 که احتمال زیاد عدد 11 اولی طول هدر است .


















13 خرداد ۱۴۰۲ شرکت در جشن ولیعهد اُردُن

















رفع خطای ثبت MSCOMCTL.OCX در ویندوز ۶۴ بیت




Regsvr32 /u  "C:\Windows\SysWOW64\MSCOMCTL.OCX" Regsvr32 "C:\Windows\SysWOW64\MSCOMCTL.OCX"








عبارت GET در Vba برای خواندن Data



داده را از فایل باز داخل یک متغیر می خواند

Syntax

Get [ # ] filenumber, [ recnumber ], varname



varString=String(10," ")

Get #1,,varString





Serial Port Setting




















Com1:9600,n,8,1






مِتُد Rename در تغییر نام شئ مثل جدول یا کوئری در ویژوال بیسیک


Docmd


expression.Rename (NewNameObjectTypeOldName)


Rename "New","Table","Old"


-آرگومان اول : نام جدید

-آرگومان دوم : نوع شئ مثل Query ، Table یا Form

-آرگومان سوم : نام فعلی


Application

expression.RefreshDatabaseWindow






شئ WshShell برای ایجاد شورتکات یا اجرای برنامه



Wscript.Shell


 زمانیکه نیاز به اجرای برنامه ای بصورت محلی ، دستکاری محتویات رجیستری ، ایجاد شورتکات ، یا دسترسی به پوشه سیستمی دارید می توانید WshShell را ایجاد نمائید.شئ WshShell مجموعه Environment را فراهم می سازد.این مجموعه یا Collection به شما اجازه می دهد تا متغیرهای محیطی ( مانند WINDIR ، PATH یا PROMPT ) را مدیریت کنید.






set oShellLink = WshShell.CreateShortcut(strDesktop & "\Shortcut Script.lnk")
oShellLink.TargetPath = WScript.ScriptFullName
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+F"
oShellLink.IconLocation = "notepad.exe, 0"
oShellLink.Description = "Shortcut Script"
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save



 



شئ Shell.Application




بعضی مِتُدها :


Explore : باز کردن یک فولدر

FileRun : باز کردن دیالوگ باکس File-Run

FindFiles : نمایش باکس Search ویندوزی

FindPrinter : نمایش باکس ویندوزی انتخاب پرینتر

MinimizeAll : مینیمایز کردن هرچیزی

("\\:NameSpace("C : ایجاد یک رفرنس شئ به فولدر

Open : بار کردن پوشه خاص

BrowseForFolder : باکس نمایش فولدرها ، نتیجه : یک شئ مرجع به شئ پوشه انتخابی ( شامل ویژگی title و self )

ShellExecute : اجرا کردی اسکریپت یا اپلیکیشن

ShutDownWindowse : نمایش باکس ShutDown ویندوز

ShowBrowseBar : نمایش نوارجستجو

ToggleDesktop : نمایش و مخفی کردن دسکتاپ

UndoMinimizeAll : از حالت مینیمایز در آوردن هر چیزی 



تابع Shell برای اجرای برنامه های اجرائی



نوشتاریِ تابع بصورت زیر و دارای دو آرگومان اجباری (Required) و اختیاری(Optional)است.اولی مسیر و نام فایل ، دومی حالت پنجره مثل vbNormalFocus یا vbHide ( پنهان می شود  )



Shell ( pathname [windowstyle ] )







متد Application.DDEInitiate آغاز مبادله داده های پویا



از تابع DDEInitiate برای شروع ارتباط مبادله داده پویا با سایر برنامه ها استفاده می شود. این تابع یک کانال برای انتقال داده بین سرور DDE و برنامه کلاینت باز می نماید


expression.DDEInitiate (ApplicationTopic)


Application : یک عبارت رشته ای نمایانگر یک برنامه که می تواند در مکالمه DDE همکاری داشته باشد.معمولا این آرگومان نام یک فایل EXE است البته بدون ذکر پسوند فایل برای برنامه های بر پایه ویندوز مثل مایکروسافت اکسل


برای مثال ، اگر تمایل به انتقال داده از کاربرگ اکسل به پایگاه داده اکسس را دارید می توانید از این تابع برای باز کردن یک کانال بین دو برنامه استفاده کنید.در این مثال اکسس بعنوان برنامه کلاینت و اکسل بعنوان برنامه سرور عمل می کند.

در صورت ارتباط موفق ، این تابع یک مکالمه DDE با برنامه و عنوان مشخص شده توسط برنامه و آرگومان های topic برقرار کرده و مقدار عددی نوع LONG را بر می گرداند.این مقدار بازگشتی یک شماره کانال یونیک و واحدی را نشان می دهد که کانالی را که انتقال داده از طریق آن می تواند انجام شود را مشخص می کند. این شماره کانال متعاقباً با سایر توابع و عبارات DDE استفاده می شود.


Dim chanNum As Variant

شروع تبادل با تابع DDEInitiate ، آرگومان اول اسم فایل Exe و آرگومان دوم نام فایل اکسس 

chanNum = DDEInitiate("MSACCESS", "dde_test.mdb")

اجرای ماکروی یک با تابع DDEExecute

DDEExecute chanNum, "[Macro1]"

خارج شدن از کانال که حتما باید انجام شود.

DDETerminate chanNum

نوشتاری تابع DDEExecute :

expression.DDEExecute (ChanNumCommand)


فرض کنید در حال اجرا کردن Word هستید و می خواهید داده را از پایگاه داده اکسس خاصی درون سندی بریزید.مکالمه DDE با اکسس بوسیله باز کردن کانال DDE با تابع DDEInitiate و مشخص کردن نام فایل پایگاه داده اکسس بعنوان topic را می توانید شروع کنید. سپس داده را از آن پایگاه داده به word از بین این کانال انتقال دهید.مایکروسافت اکسس topic های زیرین را پشتیبانی می نماید : 

-System

-نام دیتابیس

-نام جدول

-نام کوئری

-عبارت Sql 

بعد از انتشار مکالمه DDE ، می توانید از عبارت DDEExecute برای ارسال فرمان از کلاینت به برنامه سرور استفاده کنید.زمان استفاده بعنوان سرور ، اکسس هر یک از فرامین معتبر زیر را تشخیص می دهد:

-نام ماکرو در پایگاه داده جاری

-هر action که شما در ویژوال بیسیک انجام می دهید با استفاده از یکی از متدهای شئ  Docmd.

-اکشن های OpenDatabase و CloseDatabase  ، که فقط برای عملیات های DDE استفاده می شوند.



تابع DDE : 

برای مثال می توانید از این تابع در ویژگی ControlSource کنترل تکست باکس برای مشاهده داده از یک سل مشخص شده داخل شیت اکسل استفاده نمائید

DDE(applicationtopicitem)

-آرگومان اول نام برنامه اجرایی با پسوند Exe است مثل Exel یا MSAccess طبق همان فرمتی که در مسیرش وجود دارد

-آرگومان دوم یا topic اغلب یک سند مثل Sheet است ( در اکسل ) یا فایل داده ای

-آرگومان سوم یا item یک عبارت رشته ای که نام آیتم داده تشخیص داده شده توسط اپلیکیشن است . بطور مثال اگر در حال درخواست داده از اکسل هستید item بایستی بصورت نشانگر ردیف و ستون باشد مثل "R1C1" یا نام محدوده ای از سل ها


-در کمبو باکس هم می توان از داده های ستونی از اکسل استفاده کرد ولی نمی توان درقسمت تکست باکس کمبو چیزی را اضافه نمود.

-در option group و checkbox هم مورد استفاده قرار می گیرد.


















from serial port

جای com1 یا com2 می تواند شماره ip باشد

Chan = DDEInitiate("WinWedge", "Com1") MyData = DDERequest(Chan, "Field(1)")

DDETerminate Chan












جدا کردن عدد از یک متن


48-57

1- لوپ زدن در طول متن که از چندین space تشکیل شده مثل :

For i=1 To Len(sText)

2-استفاده از تابع Mid 

Mid(String,Start,Length)

Var=Mid(sText,1,i)

3-اگر Ascii code کاراکتر بین 48 تا 57 بود آن کاراکتر ( از رشته )  در متغیری موقتا ذخیرشود و در خروجی آن ارقام کنار هم نمایش داده شود.

این کدهای اسکی را می توان در جلوگیری از تایپ حروف نیز بکار برد ( در رویدادی که در  تکست باس موجود است )

می توان برای راحتر شدن از تابع IsNumeric استفاده کرد که اگر کاراکتر عددی بود در متغیری ذخیره شود.


تابع ()Asc در اکسس در مقابل تابع() Chr است.برای برگرداندن مقدار ASCII اولین کاراکتر رشته مورد استفاده قرار می گیرد.



-از تابع Split می توان استفاده کرد

-از شی RegExp در Vba نیز می توان بهره برد با استفاد از ویژگی Pattern می توان صفر تا ۹ را مشخص نمود 

[pt] >> فقط داخل براکت 

[pt^] >> شامل داخل براکت نباشد

[a-z] >> شامل حروف کوچک a تا z باشد

d >> شامل digit یا رقم

D >> شامل digit یا رقم نباشد

.  >> تک کاراکتر

n\  یاnewline

r\ یا vbCr

s\ شامل space باشد 

و استفاده از مِتُد Execute در شئ Vba.RegExp

With objRegex 

برای اجرای تابع که تمام تطابق ها در رشته را شامل شود ویژگی Global به True می بایست تنظیم شود.

.Global = True 

'.Pattern = "[^\d]+" '[NOT digit]  
.Pattern = "[\D]+" '[NOT digit] 

کاراکترهایی که ارقام نیستند را با Null جایگزین می کند 

getNumbersInString = .Replace(strIn, vbNullString) 

End With


 در زیر ویژگی Pattern عبارت A.C است اون نقطه طبق چیزی که بالا گفتیم یعنی تک کاراکتر و پس لوپ زیر تمام عباراتی که شامل سه کارکتر A تا C با داشتن یک تک کاراکتر وسط نامعلوم است را لیست می کند یعنی ABC و ADC و AJC

.Pattern = "A.C"
.Global = True
.IgnoreCase = True
stringOne = "ABC-A1289C-ADC-A1289C-AJC"
Set theMatches = regexOne.Execute(stringOne)
For Each Match In theMatches

Debug.Print Match.Value

Next

برای جدا کردن email ها :
w\ هرچیزی که شامل حرف و رقم باشد
Pattern: [\w\.\-]+@[A-Za-z0-9\.\-]+\.[A-Za-z]{2,24}
داخل براکت اولی : شامل حرف یا عدد ، نقطه یا خط ربط
بعد @
داخل براکت دومی : شامل حروف بزرگ و کوچک و ارقام
بعد دات( dot)
داخل براکت سوم : شامل حروف کوچک یا بزرگ انگلیسی 

پس ملاحظه نمودید که چندین روش برای استخراج متن مورد نظر در یک رشته وجود دارد








لایحه جدید قوه قضائیه به مجلس ( خرداد ۱۴۰۲ ) که موجبات مخالفت محجبه ها را فراهم کرد :

هیچ‌کس حق ندارد تحت عنوان امر به معروف و یا نهی از منکر نسبت به بانوانی که حجاب شرعی را رعایت نکرده اند مرتکب اعمال مجرمانه از قبیل توهین، افتراء، تهدید و یا ضرب و جرح و یا نقض حریم خصوصی آنان شوند و در صورت اقدام به مجازات مقرر در قانون محکوم خواهد شد»



















کنترل اعتبار IBAN یا شماره حساب بانکی بین المللی




Example (fictitious United Kingdom bank,2 sort code 12-34-56, account number 98765432):

IBAN :


GB82 WEST 1234 5698 7654 32
انتقال ۴ کاراکتر اول به انتها

W E S T12345698765432 G B82
تبدیل حروف به ارقام ( برای A تا Z شروع از 10 و بهمین ترتیب )


3214282912345698765432161182 Mod 97=1


 

A=10,B=11,C=12,D=13,E=14,F=15,G=16


In this example, the  algorithm for D mod 97 will be applied to D = 3214282912345698765432161182. (The digits are colour-coded to aid the description below.) If the result is one, the IBAN corresponding to D passes the check digit test.

1-Construct N from the first 9 digits of D
N = 321428291
2-Calculate N mod 97 = 70
3-Construct a new 9-digit N from the above result (step 2) followed by the next 7 digits of D.
N = 702345698
4-Calculate N mod 97 = 29
5-Construct a new 9-digit N from the above result (step 4) followed by the next 7 digits of D.
N = 297654321
6-Calculate N mod 97 = 24
7-Construct a new N from the above result (step 6) followed by the remaining 5 digits of D.
N = 2461182
8-Calculate N mod 97 = 1
From step 8, the final result is D mod 97 = 1 and the IBAN has passed this check digit test.








در چک کردن صحَّت شماره حساب ، خود فرد مسئول است و اشتباه بودن حساب شخص ، در سایت خود بانک مشخص خواهد شد نه با الگوریتم 









فرق بین ویژگیهای Text و Value همچنین استفاده از تگ های HTML



-ویژگی Text محتویات جاری کنترل است.

-ویژگی Value مقدار ذخیره شده کنترل تکست باکس است.

-ویژگی Value تا زمانیکه کنترل فوکس دارد همیشه در جریان است .

-ویژگی Value ، ویژگی Default کنترل را تنظیم یا باز می گرداند، که این ویژگی زمانیکه به صراحت نام ویژگی خاصی را مشخص نکردید ، فرض می شود.


ویژگی Value مشابه ویژگی DefaultValue که مقداری را مشخص می کند که یک ویژگی در هنگام ایجاد رکورد جدید به آن اختصاص می یابد نیست



ویژگی TextFormat را برای مشخص کردن اینکه در تکست باکس بتوانید از بعضی تگ های HTML استفاده کنید یا خیر استفاده میشود چنانچه >> به 1  تنظیم شود . بطور مثال میخواهید Bold یا Color بودن را در جاهایی از متن به دلخواه تغییر دهید.












ویژگی AppIcon یا AppTitle در اکسس


ویژگی AppIcon یک عبارت رشته ای که نام یک فایل Bitmap یا Icon است. البته شامل مسیر !!!

راحت ترین راه برای تنظیم این ویژگی استفاده از انتخاب Application Icon در جعبه دیالوگ Access Options است.همچنین می توان با استفاده از ماکرو یا ویژوال بیسیک نیز آنرا تنظیم نمود.


برای تنظیم ویژگی AppIcon با استفاده از ماکرو یا ویژوال بیسیک می بایست یا اول در آن پنجره یادشده یکبار تنظیم نمود یا این ویژگی را طبق راه ها( ی )زیر ایجاد کرد :

در یک پایگاه داده اکسس ، می توان آن را با استفاده از مِتُد CreateProperty و الحاق کردنش به مجموعه پراپرتیزهای شئ آبجکت اضافه نمود.


نوشتاری این متد با آرگومان ها که همه Optional هستند نه اجباری و لازم


expression .CreateProperty(NameTypeValueDDL)


Type :

dbBoolean

dbText

dbLong

dbByte

Ex:Name="AppIcon";Type=dbText;Value=PathOfIconOrBitmap


خطای ۳۲۷۰ بدین معنی است که ویژگی پیدا نشد.

  • Error 3270 means that the property was not found.

بالا ساختن ویژگی بود و بعد استفاده از مِتُد زیر : 

اضافه کردن ویژگی جدید به مجموعه یا کالکشن پراپرتیزها

expression .Append(Object)




با استفاده از پیام ویندوزی هم که به پنجره فرم می شود ارسال نمود می توان آیکون را ضمیمه کرد.

تابع SendMessageA و ارسال پیام ویندوزی WM_SETICON

wParam :

ICON_BIG=1

ICON_SMALL=0

lParam:

Null





























SetWindowTextA  hWndAccessApp,TitleText





مخفی کردن پنجره اصلی اکسس



advanced-installer


در رویداد بارگزاری فرم با نام لاگین می توان تابعی نوشت که از تابع ShowWondow ویندوزی  و قرار دادن مقدار صفر در آرگومان دوم آن برای مخفی کردن پنجره استفاده کند.


Private Sub Form_Load() On Error GoTo Err_Handler SetAccessWindow (SW_SHOWMINIMIZED) DoCmd.Restore Exit_Handler: Exit Sub Err_Handler: MsgBox "Error " & Err.Number & " in Form_Load procedure : " & Err.description Resume Exit_Handler End Sub

SetAccessWindow یک تابع نوشته شده توسط فرد است مثل 

SetAccessWindow(frm As Form)

که درون آن از  تابع ShowWindow  ویندوزی برای مخفی کردن پنجره چه فرم مربوطه چه خود اپلیکیشن  استفاده شده.


یک تابع که جوابش Boolean است ازکتابخانه User32 که اظهار آن در ویندوز ۶۴ بیتی با ۳۲ بیتی فرق میکند


BOOL ShowWindow( [in] HWND hWnd, [in] int nCmdShow );



*اما زمان  کلیک کردن روی TaskBar پنجره اصلی نمایان میشود


استفاده از تابع SetWindowalongPtrA و بعد استفاده از SW_HIDE برای اپلیکیشن اکسس و سپس SW_SHOW برای فرم لاگین مورد نظر 



استفاده از تابع برای تغییر Attribute پنجره مشخص شده


LONG_PTR SetWindowLongPtrA( [in] HWND hWnd, [in] int nIndex, [in] LONG_PTR dwNewLong );


nIndex :

GWL_EXSTYLE=-20

WS_EX_APPWINDOW=&H40000 


زمانیکه پنجره یا Window قابل رویت است یک پنجره top-level را داخل نوار وظیفه یا TaskBar می گنجاند.


LONG_PTR GetWindowLongPtrA( [in] HWND hWnd, [in] int nIndex );


خلاصه باید Style  را گرفت و موقتاً تغییر داد


lStyle=GetWindowLongPtrA(Login.hWnd,GWL_EXSTYLE) Or WS_EX_APPWINDOW


lStyle در آرگومان dwNewLong قرار داده می شود



می توان در پکیج نصبی از  create-desktop-shortcut استفاده کرد برای معرفی  Icon مورد نظر.  

ویژگی WindowStyle >>>  در Style ، فرضا مقدار ۱ : فعال و نمایش کردن پنجره . اگر پنجره مینیمایز یا ماکزیمایز باشد ، دستگاه آن را به سایز و موقعیت اصلی خودش باز می گرداند.



اگر خواندن متن بالا مفید واقع شد لطفا در نظرسنجی حتی خیلی کم هم شرکت نمائید 


















خواندن یک فایل باینری با عبارت Open در اکسل




Sub Temp()
Dim intFileNum%, bytTemp As Byte, intCellRow%
intFileNum = FreeFile
intCellRow = 0
Open "C:\temp.bin" For Binary Access Read As intFileNum
Do While Not EOF(intFileNum)
intCellRow = intCellRow + 1
Get intFileNum, , bytTemp 

Cells(intCellRow, 1) = bytTemp

Loop 
Close intFileNum 
End Sub


نوشتاری 

Open pathname For mode [ Access access ] [ lock ] As [ # ] filenumber [ Len = reclength ]


mode: ( اجباری )

Append,Binary,Input,OutPut Or Random

Default : Random


access : ( اختیاری )

ReadWrite, or Read Write.


filenumber: ( اجباری )

in range 1 to 511

use FreeFile function : برای بدست آورن شماره فایل موجود بعدی




در حالت های Binary ، Input و Random یک فایل را می توان با استفاده از شماره فایل متفاوت بدون بستن باز نمود. در حالت های Append و OutPut می بایست قبل از باز کردن آن با شماره فایل متفاوت ، آنرا بست.


عبارت یا دستور Get در Vba : ( خواندن داخل یک متغیر )

Reads data from an open disk file into a Variable.
Get [ # ] filenumber, [ recnumber ], varname


عبارت یا دستور Put در Vba : ( نوشتن )

Writes data from a Variable to a disk file.

Put [ # ] filenumber, [ recnumber ], varname


عبارت یا دستور Input در Vba : ( خواندن داده )


Reads data from an open sequential file and assigns the data to Variables

Input #filenumber, varlist



عبارت یا دستور Print در Vba : ( نوشتن در فایل )

Writes display-formatted data to a sequential file.

Print #filenumber, [ outputlist ]







OpenPort


Open "COM4:2400,N,8,1" For Binary Access Read Write As #1
cmnd$ = cmnd$ + Chr(13)
Put #1, , cmnd$
answer = ""
char = Input(1, #1)
While (char <> Chr(13))
If (char > Chr(31)) Then
answer = answer + char
End If
char = Input(1, #1) 'گرفتن کاراکتربعدی
Wend
Close #1



دهه سوم اردیبهشت ۱۴۰۲ :

فلاحتی امام جمعه رشت با انتقاد از حجاب برخی حاضران در مراسم گفت: سایت ها فردا می زنند نماینده ولی فقیه در جلسه ای شرکت کرد که حجاب را رعایت نکردند. من از همه زنان و دخترانی که این جا حجاب را رعایت نکرده‌اند، بیزارم...














شئ Drive و کالکشن Drives در فهرست گیری درایوهای موجود



دسترسی به ویژگیهای یک Disk Drive خاص یا اشتراک شبکه  رافراهم میسازد . دارای کالکشن Drives  و ویژگیهایی مثل DriveLetter VolumeName ، TotalSize ، FreeSpace  یاSerialNumber ( نه هارد )  و ... است


اسم متغیر Fso که با Set همراه میشود

CreateObject("Scripting.FileSystemObject")

For Each D in Fso.Drives

Debug.Print D.DriveLetter & ";"  & _

       D.SerialNumber & ";" & _

       D.TotalSize

Next


مِتُد GetDrive :

Declare A Variable Like fso

GetDrive("D:")

.DriveLetter

.TotalSize



The drivespec argument can be a drive letter (c), a drive letter with a colon appended (c:), a drive letter with a colon and path separator appended (c:), or any network share specification (\computer2\share1)











احمد شاه قاجار، آخرین شاه سلسله قاجار نهم اسفند ۱۳۰۸ درست ۴ سال و ۴ ماه پس از خلع قاجاریه از سلطنت ایران در ۳۲ سالگی در پاریس و در تبعید درگذشت. وی دچار اضافه وزن و بیماری کلیوی بود. احمدشاه را در تیرماه ۱۲۸۸ در ۱۲ سالگی برجای پدرش نشانده بودند. او در سال ۱۳۰۲ سه سال پس از کودتای رضا خان، از سلطنت خلع شده بود. احمد شاه به اراده خود به اروپا رفت، اما دیگر به او اجازه بازگشت داده نشد.










بررسی وجود یک فولدر با استفاده از شئ Scripting.FileSystemObjecf



در صورتیکه پوشه مورد نظر موجود باشد True و در غیر اینصورت False را بر میگرداند


نوشتاری این متد :

Object.FolderExists(filespec)