Last post Mar 16, 2014 08:07 AM by arkanturk
Mar 15, 2014 07:56 AM|arkanturk|LINK
I have VWD 2010 Express File System web site, which is active on hosting server.
The User creates a text file, selecting and writing data using a series of DropDownList, Button and
TextBox in relevant pages.
After some math. calculations, the final code in the class file is as follows:
My.Computer.FileSystem.WriteAllText("C:\SITE_NAME\Result.txt", vbNewLine & " CATAGORY - " & Random_S & "; ( "
& aa & " - " & bb & " - " & cc & " - " & dd & " - " & ee & " - " & ff & ")", True)
The path of Result.txt file is :
In local machine: C:\SITE_NAME\Result.txt
In hosting server: ftp://ftp.DOMAIN/http/Result.txt
In local machine I can approach and display the Result.txt file. But the User can't, due to the path
C:\SITE_NAME\Result.txt is not exist in their machines.
I can redevelop the website from File System to FTP System. Does it help ?
How can I solve this problem???
Any suggestions much appreciated.
Mar 15, 2014 08:14 AM|kaushalparik27|LINK
Try creating the text file in root of your application which infact, I guess you are trying to do the same. Check out below code on how you can write textfile under the root folder (Site_Name folder) of your application
System.IO.File.WriteAllText(Server.MapPath("~/Result.txt"), vbNewLine & " CATAGORY - " & Random_S & "; ( "& aa & " - " & bb & " - " & cc & " - " & dd & " - " & ee & " - " & ff & ")")
hope it helps./.
Mar 16, 2014 08:07 AM|arkanturk|LINK
Server is not declared. It may be inaccessible due to its protection level
Error Correction Options;
Change ‘Server ‘to ‘IObserver’
Generate method stub for ‘Server’ in ‘Class1’
Generate property stub for ‘Server’ in ‘Class1’
Generate field for for ‘Server’ in ‘Class1’
Generate ‘Class Server
Generate new type
I tried to generate a field for server in Class1 but I don’t know (??) to be used in
Private Server_v As (??)
Public Property Server() As (??)
Set(value As (??))
Server_v = value
I tried AppDomain for (??), but the answer received is ‘MapPath’ is not a member of ‘System.AppDomain’
The same answers received for the words hereunder.
AppDomainInitializer, AppDomainManager, AppDomainManagerInitializationOptions
AppDomainSetup, AppDomainUnloadedException, CrossAppDomainDelegate
Could you propose me (??) in order to continue the debugging.