I hope this is the right place to put this question, in case not, feel free to tell me where to post this issue!
First: Development based on Visual Web Developer with VB.NET language.
I prepared few pages of my website and all is ok when on a Desktop PC I load the pages and the controls, but something strange happen when I try with an iPhone (or in general with a Smartphone) to get access to my website.
The probelm is that I've on the VB.NET script the reading of a File loaded on a directory in my website, the file is atext file. To read the data inside the txt file I use this command line:
When I load this page with a desktop pc with Firefox or Internet Explorer, everything work fine, the system read the value wrote in the File.txt and display it in a Textbox1 as I programmed in the next code lines. But this not happen when I use my Smartphone.
Looking in Google I found a geek that says: "...you cannot use My.Computer.System.... with mobile phone, you have to use this command:
Dim s As StreamReader = New StreamReader("F:\vhosts\MyWebSite\httpdocs\File.txt")
TextBox1.Text = s.ReadLine"
So I tried to use this code, but also this one it's working on PC-Desktop but not with mobile phone!
First: Why it works to retrieve data from the txt file with normal web broswer on a Desktop PC (For example Internet Explorer, Mozilla Firefox) and it's not work on mobile phone web browser?
Second: What should I've to do to to use "virtual path"? I mean, this is the code I use now:
Dim sr As StreamReader = New StreamReader("F:\vhosts\gestioneremota.com\httpdocs\Clienti\SpedaliCivili\Giorni_Licenza.txt")
TextBox1.Text = sr.ReadLine
sr.Close()
My problem is not related to the path, the Firefox or Internet Explorer browser have no problem to retrieve the datas from the txt file, so I assume that the path is correct. The problem is when I use the browser of a mobile phone, for example iPhone. It
cannot read the datas from txt file or it cannot even reach the txt file. I don't know exactly which is the problem but something is missed when is a browser from a mobile phone that try to get this datas!
rivettim
Member
22 Points
12 Posts
My.Computer.Filesystem... doesn't work with mobile! Read txt files
Mar 14, 2012 01:44 PM|LINK
Hi everybody,
I hope this is the right place to put this question, in case not, feel free to tell me where to post this issue!
First: Development based on Visual Web Developer with VB.NET language.
I prepared few pages of my website and all is ok when on a Desktop PC I load the pages and the controls, but something strange happen when I try with an iPhone (or in general with a Smartphone) to get access to my website.
The probelm is that I've on the VB.NET script the reading of a File loaded on a directory in my website, the file is atext file. To read the data inside the txt file I use this command line:
"My.Computer.FileSystem.ReadAllText("F:\vhosts\MyWebSite\httpdocs\File.txt")"
When I load this page with a desktop pc with Firefox or Internet Explorer, everything work fine, the system read the value wrote in the File.txt and display it in a Textbox1 as I programmed in the next code lines. But this not happen when I use my Smartphone.
Looking in Google I found a geek that says: "...you cannot use My.Computer.System.... with mobile phone, you have to use this command:
Dim s As StreamReader = New StreamReader("F:\vhosts\MyWebSite\httpdocs\File.txt")
TextBox1.Text = s.ReadLine"
So I tried to use this code, but also this one it's working on PC-Desktop but not with mobile phone!
Some other ideas??????
Thank you sooooooooo much!
</div>txt read
jagjot
Contributor
2648 Points
1229 Posts
Re: My.Computer.Filesystem... doesn't work with mobile! Read txt files
Mar 14, 2012 02:16 PM|LINK
Problem is your physical path to your file.
Assuming your application is server based. you should use virtual path or your domain/server/files.
Then comes the streamreader step.
txt read
M.Sc, MIEEE, MCP, CCNA
rivettim
Member
22 Points
12 Posts
Re: My.Computer.Filesystem... doesn't work with mobile! Read txt files
Mar 14, 2012 02:37 PM|LINK
Hi, thanks for your time, but I don't understand!
First: Why it works to retrieve data from the txt file with normal web broswer on a Desktop PC (For example Internet Explorer, Mozilla Firefox) and it's not work on mobile phone web browser?
Second: What should I've to do to to use "virtual path"? I mean, this is the code I use now:
Dim sr As StreamReader = New StreamReader("F:\vhosts\gestioneremota.com\httpdocs\Clienti\SpedaliCivili\Giorni_Licenza.txt")
TextBox1.Text = sr.ReadLine
sr.Close()
How should I've to change it?
Thanks
jagjot
Contributor
2648 Points
1229 Posts
Re: My.Computer.Filesystem... doesn't work with mobile! Read txt files
Mar 14, 2012 03:00 PM|LINK
if i understand you right? will be easier to answer your questions?
Where is your application hosted? on your development pc or web server on internet?
M.Sc, MIEEE, MCP, CCNA
rivettim
Member
22 Points
12 Posts
Re: My.Computer.Filesystem... doesn't work with mobile! Read txt files
Mar 14, 2012 03:17 PM|LINK
Yes, good point! :-)
My application is on a web server on internet (by a service provider).
I make modification on my pc and then I load to the hosting service provider and I try the modifications.
jagjot
Contributor
2648 Points
1229 Posts
Re: My.Computer.Filesystem... doesn't work with mobile! Read txt files
Mar 14, 2012 03:21 PM|LINK
check this article.
http://msdn.microsoft.com/en-us/library/ms178116.aspx
hope its helpful....
M.Sc, MIEEE, MCP, CCNA
rivettim
Member
22 Points
12 Posts
Re: My.Computer.Filesystem... doesn't work with mobile! Read txt files
Mar 14, 2012 03:47 PM|LINK
Thanks, but it's not helpfull!
My problem is not related to the path, the Firefox or Internet Explorer browser have no problem to retrieve the datas from the txt file, so I assume that the path is correct. The problem is when I use the browser of a mobile phone, for example iPhone. It cannot read the datas from txt file or it cannot even reach the txt file. I don't know exactly which is the problem but something is missed when is a browser from a mobile phone that try to get this datas!
jagjot
Contributor
2648 Points
1229 Posts
Re: My.Computer.Filesystem... doesn't work with mobile! Read txt files
Mar 14, 2012 03:59 PM|LINK
which phone/browser you are using?
M.Sc, MIEEE, MCP, CCNA
rivettim
Member
22 Points
12 Posts
Re: My.Computer.Filesystem... doesn't work with mobile! Read txt files
Mar 14, 2012 04:09 PM|LINK
I wrote that I use iPhone to try.