Home > Software engineering >  How to use vb to read LAN D plate under the path of a test. The JPG file, need dynamic access to the
How to use vb to read LAN D plate under the path of a test. The JPG file, need dynamic access to the

Time:10-17

How to use vb to read LAN D plate under the path of a test. The JPG file, need dynamic access to the full path?
I wanted to do a program by the client computer, the process need to read the server (LAN IP: 192.168.1.99) D disk volume label is a local disk (D), the file is text. JPG, I am in the process of access path, if D disk volume label in English, such as SOFTWARE (D) can be read smoothly to the correct path, if is Chinese, local disk (D) this name is unable to read the complete path, consult everybody masters now is there any way to help the younger brother to solve, thank you! Grateful to disrespect!
Master or if it can be a one-time use vb direct access to the server test. JPG the full path, so much the better, thank you!

CodePudding user response:

Generate a batch file a. at:
 net use z: \ \ 192.168.1.99 \ d $password 
Dir/b/s z: \ text JPG & gt; Pf. TXT
Net use z:/delete

A.
 Shell "at", vbHide 
'and then read the file pf. TXT content

CodePudding user response:

Zhao4zhong1 hello, thank you for your answer, but also please point in detail explain in detail the processing method, or vb source code examples related? thank you

CodePudding user response:

reference 1st floor zhao4zhong1 response:
generate a batch file a. at:
 net use z: \ \ 192.168.1.99 \ d $password 
Dir/b/s z: \ text JPG & gt; Pf. TXT
Net use z:/delete

A.
 Shell "at", vbHide 
'and then read the file pf. TXT content


Zhao4zhong1 hello, thank you for your answer, but also please point in detail explain in detail the processing method, or vb source code examples related? thank you

CodePudding user response:

Replace the password for the share name \ \ 192.168.1.99 \ d $corresponding password
 dim f as integer 
Dim pf the as string
F=freefile ()
A. open "at" for the output as # f
Print # f, "net use z: \ \ 192.168.1.99 \ d $password", "
Print # f, "dir/b/s z: \ text JPG & gt; Pf. TXT "
Print # f, "net use z:/delete"
Close # f
A. at the "shell", vbHide
Kill a. at
F=freefile ()
Open "pf. TXT" for input as # f
The line input # f, pf
Close # f
The debug. Print "pf=[" + +" pf] "

CodePudding user response:

A. line 10 kill a. at should be changed to kill "at"

CodePudding user response:

reference 4 floor zhao4zhong1 response:
to the password to replace for the share name \ \ 192.168.1.99 \ d $corresponding password
 dim f as integer 
Dim pf the as string
F=freefile ()
A. open "at" for the output as # f
Print # f, "net use z: \ \ 192.168.1.99 \ d $password", "
Print # f, "dir/b/s z: \ text JPG & gt; Pf. TXT "
Print # f, "net use z:/delete"
Close # f
A. at the "shell", vbHide
Kill a. at
F=freefile ()
Open "pf. TXT" for input as # f
The line input # f, pf
Close # f
The debug. Print "pf=[" + +" pf] "

Ok, thanks, I try it! Thank you very much

CodePudding user response:

reference 4 floor zhao4zhong1 response:
to the password to replace for the share name \ \ 192.168.1.99 \ d $corresponding password
 dim f as integer 
Dim pf the as string
F=freefile ()
A. open "at" for the output as # f
Print # f, "net use z: \ \ 192.168.1.99 \ d $password", "
Print # f, "dir/b/s z: \ text JPG & gt; Pf. TXT "
Print # f, "net use z:/delete"
Close # f
A. at the "shell", vbHide
Kill a. at
F=freefile ()
Open "pf. TXT" for input as # f
The line input # f, pf
Close # f
The debug. Print "pf=[" + +" pf] "

Hello, test, prompt line 12 Open "pf. TXT" For Input As # f to find this file

CodePudding user response:

refer to 6th floor tim_liang999 response:
Quote: refer to 4th floor zhao4zhong1 response:

Replace the password for the share name \ \ 192.168.1.99 \ d $corresponding password
 dim f as integer 
Dim pf the as string
F=freefile ()
A. open "at" for the output as # f
Print # f, "net use z: \ \ 192.168.1.99 \ d $password", "
Print # f, "dir/b/s z: \ text JPG & gt; Pf. TXT "
Print # f, "net use z:/delete"
Close # f
A. at the "shell", vbHide
Kill a. at
F=freefile ()
Open "pf. TXT" for input as # f
The line input # f, pf
Close # f
The debug. Print "pf=[" + +" pf] "

Ok, thanks, I try it! Thank you very much


Junction post rate: 20% score # 7:0 reply in: the 2013-12-16 15:22:09
Refer to 4th floor zhao4zhong1 response:
Replace the password for the share name \ \ 192.168.1.99 \ d $corresponding password

Visual Basic code? 123456789101112131415 dim f as integer dim pf the as string=freefile f () open "a. at" for the output as the print # # f f, "net use z: \ \ 192.168.1.99 \ d $password" print # f, "dir/b/s z: \ text JPG & gt; Pf. TXT "print # f," net use z:/delete "close # f shell a." at ", vbHide kill a. at f=freefile () open "pf. TXT" for input as # f line input # f, pf the close # f the debug. Print "pf=[" + +" pf] "
Hello, test, prompt line 12 Open "pf. TXT" For Input As # f to find this file

reference 4 floor zhao4zhong1 response:
to the password to replace for the share name \ \ 192.168.1.99 \ d $corresponding password
 dim f as integer 
Dim pf the as string
F=freefile ()
A. open "at" for the output as # f
Print # f, "net use z: \ \ 192.168.1.99 \ d $password", "
Print # f, "dir/b/s z: \ text JPG & gt; Pf. TXT "
Print # f, "net use z:/delete"
Close # f
A. at the "shell", vbHide
Kill a. at
F=freefile ()
Open "pf. TXT" for input as # f
The line input # f, pf
Close # f
The debug. Print "pf=[" + +" pf] "


Junction post rate: 20% score # 7:0 reply in: the 2013-12-16 15:22:09
Refer to 4th floor zhao4zhong1 response:
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related