473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

C#-APP: Problems with StreamWriter

Hello,

I have a script that already outputs a file in the correct format how I desire but I have run into a problem after I tried advancing the code.

I am building a web application, via php, that will operate off of scripts generated from this method but the problem occurs once I change the export path from a local string to a web string.

In other words, I don't want to write to "C:/some folder" but "myurl.com/some folder"

The domain itself is on a remote server. Also, this will be a widely used application therefore it needs to be applicable to a fully functional shared hosting plan.

The line itself reads as,
Expand|Select|Wrap|Line Numbers
  1. using ( StreamWriter op = new StreamWriter( "SomePath" ) )
I have tried several methods including "ftp://user:pass@domain.com/public_html/" etc. I've also tried adopting port 80 access. I am rather new to C# so I may not come across as very competent here.

Your suggestions and answers are much appreciated,
Thank you.
Jun 1 '07 #1
3 1495
kenobewan
4,871 Expert 4TB
What is your server platform?
Jun 1 '07 #2
Plater
7,872 Expert 4TB
if you have windows(samba) sharing allowed, try the UNC path type of "\\myserver\myscriptfolder\myfile.txt" and the like.

StreamWriter and all other file actions are looking for a "hard" link to a file. You have to be able to get there via some sort of standard file-system structure (such as opening up "My Compter" in windows and picking your harddrive, or picking a remote computer from "Network Places")

If you wanted to setup some kind of (Secure) php script on the server for it, you could make your windows app POST the script (like you would in a form) using the WebRequest object.
Jun 1 '07 #3
Thank you.

This has resolved my issue.

PS: The POST action was perfect, it removed a clunky cron job.
Jun 2 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Daniel | last post by:
i would like to konw when the data sent so that i can close the streamwriter and networkstream is there some sort of call backs/events i have to implement for this to work? if so how? can i just...
5
by: Brendan Miller | last post by:
Hi, I have been having a problem writing the contents of a dataset to a .csv file. When I write to a .csv file and open it with either Excel or Wordpad the "french" characters are wrong. When I...
2
by: kj96 | last post by:
I have a intranet page that I want to use to open a certain file from a network location make changes to it and then write the changed file back to the same network location <my try at the code>...
2
by: RicercatoreSbadato | last post by:
RicercatoreSbadatoI have some big problems with the StreamWriter and MediaDet. I have read that StreamWriter isn't threadsafe from the MSDN.. I have used a lock() but nothing...
10
by: Oscar Thornell | last post by:
Hi, I generate and temporary saves a text file to disk. Later I upload this file to Microsoft MapPoint (not so important). The file needs to be in UTF-8 encoding and I explicitly use the...
4
by: HNguyen | last post by:
Hi, I have a Web application in ASP.NET. My Application allows the users upload files into the server after checking their user names and passwords. For each transaction, the Web program will...
6
by: Don | last post by:
I'm having problems working with a streamwriter object. After closing the streamwriter and setting it to Nothing, I try to delete the file it was writing to, but I always get the following error...
0
by: Andrea Temporin | last post by:
We are working on a Db Oracle accessed by Oledb. We get connection using MSDAORA.1 provider ad ORACLE 9.2 drivers on the PC. We create datatables associated to the tables on the db, using...
4
by: Mads Westen | last post by:
Hi, I'm parsing some XML files, and converting them to CSV. I got x number of XML files in a directory, these files do I need to be converted and written to the same CSV file. My problem is...
2
by: Andez | last post by:
I've wrote a windows service that performs simple functions within our application. To ensure safe running of the service - if it errors we want to know where when how - it logs to a text file - in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.