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 I load the pages and the controls, but something strange happen when I try with an iPhone (or in general witha a Smartphone) to get access to my website.
The probelm is that I've on the VB.NET script the reading of a File.txt file loaded on my website; I use this command line:
When I access this page with a desktop pc with Firefox or Internet Explorer, everything work fine, the system read the value wrote in the File.txt file and display in the Textbox1. 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"
I checked the pages you posted, but they refer to problem with "downloading" file to mobile device.
My issue is different.
I don't need to download a file, I need to open a text file to read the content and write the value i found in the text file on a textbox.
When I browse the webpage with a browser on a Pc everything works good! When I try with the browser of a smartphone (like iPhone) I've no data in the label. It's like that the browser in the mobile phone cannot recognize the vbscript "My.Computer.systemfiles...."
to read the value wrote in the txt file!
Tell me if I was unclear on which task I've to perform.
thanks for your time, but or I don't understand exactly what you mean or there is something strange.
I explain:
When with my iPhone I load mywebsite pages, some of the VB.NET code is executed, for example I've a construct like this:
Select Case Choice
Case 1
Response.Redirect(Page1)
Case 2
Responde.Redirect(Page2)
...
And this part is executed in the right way both, via a PC with an Internet broswer and with the iPhone. And that code in wrote on a VB file that is loaded togheter with the .aspx file of the page.
On a Pc with for example Firefox it's works fine, with IExplorer it's also work fine, on an iPad it's work fine, on a Mobile phone with Android it's work fine, but with iPhone it doesn't work!!!!!!!!
So, it's like that iPhone can manage some of the VB.NET code lines and some other no!
Hi, don't sorry, I can understand that I was not clear, and again I semplfy my code and I gave you a slightly misunderstandable information!
The problem is not even the path because if the path is wrong, is wrong for all the Web Browser. In fact, I didn't mentioned that I bring the physical path. I copy here my exactly code:
Yes, as I mentioned in previous posts (you can see it few messages before your) the application works fine with Android (I tried with a Samsung Galaxy) and even with iPad2 its work fine!!!!
Member
2 Points
12 Posts
Page load on a Smartphone
Mar 06, 2012 09:47 AM|rivettim|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 I load the pages and the controls, but something strange happen when I try with an iPhone (or in general witha a Smartphone) to get access to my website.
The probelm is that I've on the VB.NET script the reading of a File.txt file loaded on my website; I use this command line:
"TextBox1.Text = My.Computer.FileSystem.ReadAllText("F:\vhosts\MyWebSite\httpdocs\File.txt")"
When I access this page with a desktop pc with Firefox or Internet Explorer, everything work fine, the system read the value wrote in the File.txt file and display in the Textbox1. 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 did, but also this one it's not working!
Some other ideas??????
Thank you sooooooooo much!
Participant
1021 Points
223 Posts
Re: Page load on a Smartphone
Mar 07, 2012 10:06 PM|SonicMan|LINK
Hi
I'm not sure about that.
You can go to the Windows phone forum for this question.
I'm sure you can get the answer there.
Here I think it's may because phone can't use this API.
This may help:
http://support.microsoft.com/kb/307256
http://www.vbdotnetforums.com/vb-net-general-discussion/21011-my-computer-filesystem-findinfiles-unauthorizedaccessexception-directorysecurity.html#post63989
Member
2 Points
12 Posts
Re: Page load on a Smartphone
Mar 14, 2012 05:55 AM|rivettim|LINK
Thank you for your help!
I checked the pages you posted, but they refer to problem with "downloading" file to mobile device.
My issue is different.
I don't need to download a file, I need to open a text file to read the content and write the value i found in the text file on a textbox.
When I browse the webpage with a browser on a Pc everything works good! When I try with the browser of a smartphone (like iPhone) I've no data in the label. It's like that the browser in the mobile phone cannot recognize the vbscript "My.Computer.systemfiles...." to read the value wrote in the txt file!
Tell me if I was unclear on which task I've to perform.
Thanks!
Star
14065 Points
3270 Posts
Re: Page load on a Smartphone
Mar 15, 2012 11:35 PM|roopeshreddy|LINK
Hi,
VbScript is not supported in Apple iPhone Mobile Safari browser!
It's better to read the file using VB.NET and update the text in the textbox.
http://www.codeproject.com/Articles/251/Reading-a-text-file-in-ASP
Hope it helps u...
Roopesh Reddy C
Roopesh's Space
Member
2 Points
12 Posts
Re: Page load on a Smartphone
Mar 20, 2012 01:22 PM|rivettim|LINK
Hi,
thanks for your time, but or I don't understand exactly what you mean or there is something strange.
I explain:
When with my iPhone I load mywebsite pages, some of the VB.NET code is executed, for example I've a construct like this:
Select Case Choice
Case 1
Response.Redirect(Page1)
Case 2
Responde.Redirect(Page2)
...
And this part is executed in the right way both, via a PC with an Internet broswer and with the iPhone. And that code in wrote on a VB file that is loaded togheter with the .aspx file of the page.
But when in a line in the vb file there is:
My.Computer.FileSystem.WriteAllText("Mywebsite\Docs\File.txt", "1", False)
On a Pc with for example Firefox it's works fine, with IExplorer it's also work fine, on an iPad it's work fine, on a Mobile phone with Android it's work fine, but with iPhone it doesn't work!!!!!!!!
So, it's like that iPhone can manage some of the VB.NET code lines and some other no!
I'm getting crazy about this!!!
Star
14065 Points
3270 Posts
Re: Page load on a Smartphone
Mar 21, 2012 01:32 AM|roopeshreddy|LINK
Hi,
Sorry! I just misunderstood ur question! I thought you are talking about VbScript!
You have specified the path which is absolute. Since you may be working local for IE and Mozilla, then it is working for u.
You may try MapPath() function which will helps u!
http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.mappath.aspx#Y0
Hope it helps u...
Roopesh Reddy C
Roopesh's Space
Member
2 Points
12 Posts
Re: Page load on a Smartphone
Mar 21, 2012 03:43 AM|rivettim|LINK
Hi, don't sorry, I can understand that I was not clear, and again I semplfy my code and I gave you a slightly misunderstandable information!
The problem is not even the path because if the path is wrong, is wrong for all the Web Browser. In fact, I didn't mentioned that I bring the physical path. I copy here my exactly code:
path = Server.HtmlEncode(Request.PhysicalApplicationPath)
TextBox1.Text = My.Computer.FileSystem.ReadAllText(path & "Clienti\File.txt")
Any other suggestion?
Thanks!!!!!
Star
14065 Points
3270 Posts
Re: Page load on a Smartphone
Mar 21, 2012 07:49 AM|roopeshreddy|LINK
Hi,
It shouldn't give any problem! Did you tried in any other Mobile devices other than iPhone? i mean Android, WindowsPhone etc.,
Can you try in other mobile devices and let us know!
Hope it helps u...
Roopesh Reddy C
Roopesh's Space
Member
2 Points
12 Posts
Re: Page load on a Smartphone
Mar 21, 2012 09:47 AM|rivettim|LINK
Yes, as I mentioned in previous posts (you can see it few messages before your) the application works fine with Android (I tried with a Samsung Galaxy) and even with iPad2 its work fine!!!!
Star
14065 Points
3270 Posts
Re: Page load on a Smartphone
Mar 21, 2012 11:27 AM|roopeshreddy|LINK
Hi,
If it is working with Apple iPad, then it should work fine in Apple iPhone too!
Is the iOS version same in both Apple iPhone and iPad?
May be some settings in the iPhone is causing u the problem?
Hope it helps u...
Roopesh Reddy C
Roopesh's Space
Member
2 Points
12 Posts
Re: Page load on a Smartphone
Mar 21, 2012 11:35 AM|rivettim|LINK
YESSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
You have got the point!!!!!!!!!!!!!!!!!!!!!!!!!
Was the cookie disable on the iPhone that blocked this part of the execution!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
THANKS YOU SOOOOOOOOOOOOOOOOOOOOOO MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :-)
Star
14065 Points
3270 Posts
Re: Page load on a Smartphone
Mar 21, 2012 11:57 AM|roopeshreddy|LINK
Hi,
if my post helped u, then mark it as answer, so that it will help others!
Hope it helps u...
Roopesh Reddy C
Roopesh's Space
Member
2 Points
12 Posts
Re: Page load on a Smartphone
Mar 21, 2012 12:03 PM|rivettim|LINK
Yes! Of course!!!! :-)