locked
Page load on a Smartphone RRS feed

  • Question

  • User-1938568238 posted

    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!

    Tuesday, March 6, 2012 9:47 AM

Answers

  • User1274561869 posted

    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

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 7, 2012 10:06 PM
  • User1943143334 posted

    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...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 21, 2012 11:27 AM
  • User1943143334 posted

    Hi,

    if my post helped u, then mark it as answer, so that it will help others!

    Hope it helps u...

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 21, 2012 11:57 AM

All replies

  • User1274561869 posted

    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

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 7, 2012 10:06 PM
  • User-1938568238 posted

    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!

    Wednesday, March 14, 2012 5:55 AM
  • User1943143334 posted

    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...

    Thursday, March 15, 2012 11:35 PM
  • User-1938568238 posted

    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!!!

    Tuesday, March 20, 2012 1:22 PM
  • User1943143334 posted

    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...

    Wednesday, March 21, 2012 1:32 AM
  • User-1938568238 posted

    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!!!!!

    Wednesday, March 21, 2012 3:43 AM
  • User1943143334 posted

    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...

    Wednesday, March 21, 2012 7:49 AM
  • User-1938568238 posted

    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!!!!

    Wednesday, March 21, 2012 9:47 AM
  • User1943143334 posted

    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...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 21, 2012 11:27 AM
  • User-1938568238 posted

    YESSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

    You have got the point!!!!!!!!!!!!!!!!!!!!!!!!!

    Was the cookie disable on the iPhone that blocked this part of the execution!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    THANKS YOU SOOOOOOOOOOOOOOOOOOOOOO MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :-)

    Wednesday, March 21, 2012 11:35 AM
  • User1943143334 posted

    Hi,

    if my post helped u, then mark it as answer, so that it will help others!

    Hope it helps u...

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 21, 2012 11:57 AM
  • User-1938568238 posted

    Yes! Of course!!!! :-)

    Wednesday, March 21, 2012 12:03 PM