List Info

Thread: Re: Where did I get lost?




Re: Where did I get lost?
user name
2005-07-29 09:09:06
I think this should give you the path. ;
 
HttpContext.Current.Request.ApplicationPath;


 
On 7/29/05, Stephen Russell < srusselllotmate.com">srusselllotmate.com> wrote:
Thanks for the reply.
 
This is getting designed for a hosted site, so how do you reference that path to the ROOT of your hosted space?&nbsp; I thought that ~ did that for you, or it has for me for years.
 
Line 1 i declare the path two folders below where I am working.&nbsp; Line 2 gets that path. ;

string

file ="~/Bulletin/&quot;+FilePath+"/&quot;+FileName;

FileInfo fi=
new FileInfo(file);
Is there another method other then FileInfo to use at this point?
 
I can't seem to get Request.MapPath which is probably my failure.

Stephen Russell
S.R. & Associates
Memphis, TN 38115

901.246-0159

http://spaces.msn.com/members/srussell/

 


From: Rizwan Ahmed [mailto:yahoo.com" target="_blank">rizwanahmed81yahoo.com]
Sent: Friday, July 29, 2005 7:28 AM
To: Microsofts_C_Sharp@yahoogroups.com
Subject: Re: [Microsofts_C_Sharp] Where did I get lost?

&nbsp;
Hey Chris,
&nbsp;
FileInfo would require to give full file path.
that is C:...FileName.ext
&nbsp;
hope this hellps.
 
Regards,
Rizwan Ahmed

Chris Cottrell <gmail.com" target="_blank">ctcottrellgmail.com> wrote:
I think it is probably erroring out after the FileInfo constructor if file is not a full path. ; I don't think it uses the current directory.
 
Chris

&nbsp;
On 7/28/05, Stephen Russell <lotmate.com" target="_blank">srusselllotmate.com > wrote:

Have a filestream off of my dev-box in a WebService that doesn't see where I
think it should.&nbsp; My dir is off of InetPubwwwrootMyDir.

FileInfo fi=new FileInfo(file);  shows theDirectory name below

DirectoryName&nbsp;  "C:WINDOWSsystem32~BulletinAdvertising"
File I pass in &nbsp; &nbsp; "~/Bulletin/Advertising/HY25-2452-M1_US.pdf"

Where is this going wrong?&nbsp; This is the next set of code, and .Exists never
hits.

if (fi.Exists)
{
 &nbsp;   ;  string ex1="";
}
FileStream fs=fi.OpenRead();

TIA


Stephen Russell
S.R. & Associates
Memphis, TN 38115

901.246-0159

http://spaces.msn.com/members/srussell/




Yahoo! Groups Links

<;*> To visit your group on the web, go to:
 &nbsp; http://groups.yahoo.com/group/Microsofts_C_Sharp/

&lt;*> To unsubscribe from this group, send an email to:
   Microsofts_C_Sharp-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
   http://docs.yahoo.com/info/terms/






Rizwan Ahmed

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

YAHOO! GROUPS LINKS




RE: Where did I get lost?
user name
2005-07-29 14:53:57
Perfect!
 

string tr = HttpContext.Current.Request.ApplicationPath;

string file = Server.MapPath(tr);

file = file +"\Bulletin\"+FilePath+"\"+FileName ;

Took a litle time with other calls at day gig. 

&nbsp;

Stephen Russell
S.R. & Associates
Memphis, TN 38115

901.246-0159

http://spaces.msn.com/members/srussell/

 


From: Chris Cottrell [mailto:ctcottrellgmail.com]
Sent: Friday, July 29, 2005 9:09 AM
To: Microsofts_C_Sharp@yahoogroups.com
Subject: Re: [Microsofts_C_Sharp] Where did I get lost?

I think this should give you the path. ;
 
HttpContext.Current.Request.ApplicationPath;


 
On 7/29/05, Stephen Russell <lotmate.com">srusselllotmate.com> wrote:
Thanks for the reply.
 
This is getting designed for a hosted site, so how do you reference that path to the ROOT of your hosted space?&nbsp; I thought that ~ did that for you, or it has for me for years.
 
Line 1 i declare the path two folders below where I am working.&nbsp; Line 2 gets that path. ;

string

file ="~/Bulletin/"+FilePath+"/"+FileName;

FileInfo fi=
new FileInfo(file);
Is there another method other then FileInfo to use at this point?
 
I can't seem to get Request.MapPath which is probably my failure.

Stephen Russell
S.R. & Associates
Memphis, TN 38115

901.246-0159

http://spaces.msn.com/members/srussell/

 


From: Rizwan Ahmed [mailto:yahoo.com" target=_blank>rizwanahmed81yahoo.com]
Sent: Friday, July 29, 2005 7:28 AM
To: Microsofts_C_Sharp@yahoogroups.com
Subject: Re: [Microsofts_C_Sharp] Where did I get lost?

&nbsp;
Hey Chris,
 
FileInfo would require to give full file path.
that is C:...FileName.ext
 
hope this hellps.
 
Regards,
Rizwan Ahmed

Chris Cottrell <gmail.com" target=_blank>ctcottrellgmail.com> wrote:
I think it is probably erroring out after the FileInfo constructor if file is not a full path. ; I don't think it uses the current directory.
 
Chris

&nbsp;
On 7/28/05, Stephen Russell <lotmate.com" target=_blank>srusselllotmate.com > wrote:

Have a filestream off of my dev-box in a WebService that doesn't see where I
think it should.&nbsp; My dir is off of InetPubwwwrootMyDir.

FileInfo fi=new FileInfo(file);  shows theDirectory name below

DirectoryName&nbsp;  "C:WINDOWSsystem32~BulletinAdvertising"
File I pass in &nbsp; &nbsp; "~/Bulletin/Advertising/HY25-2452-M1_US.pdf"

Where is this going wrong?&nbsp; This is the next set of code, and .Exists never
hits.

if (fi.Exists)
{
 &nbsp;   ;  string ex1="";
}
FileStream fs=fi.OpenRead();

TIA


Stephen Russell
S.R. & Associates
Memphis, TN 38115

901.246-0159

http://spaces.msn.com/members/srussell/




Yahoo! Groups Links

<;*> To visit your group on the web, go to:
 &nbsp; http://groups.yahoo.com/group/Microsofts_C_Sharp/

&lt;*> To unsubscribe from this group, send an email to:
   Microsofts_C_Sharp-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
   http://docs.yahoo.com/info/terms/






Rizwan Ahmed

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

YAHOO! GROUPS LINKS




[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )