|
Hi all,
it may be a simple one but i dont know how to do it
In my C#.net 3.5 windows application, i have to create a separate file(like Code File)
here i will give some text and this text i want to read from coding.
is it possible?
please give some idea or please share some sample code if u have.
Thanks In Advance
--Naren
|
|
|
|
|
i want to add a textfile(.txt) to setup of my project
|
|
|
|
|
You have to create the file in the Program Data folder. Vista won't allow you to create it in the Program Files folder.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
how can i get path of my application folder?
|
|
|
|
|
Application.StartupPath;
this is a string representing the full path where the application executable was started
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
That's not available in WPF.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: That's not available in WPF.
I didnt see anything about WPF....
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
If he wants to move the app to WPF, he will have issues if he uses that particular method. It's all about maintainability.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Does this still work in WPF:
System.Reflection.Assembly.GetExecutingAssembly.Location
(not the best way to do it but a way )
|
|
|
|
|
That's not always reliable. Try this[^] way instead.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
it is just a c#.net windows application
|
|
|
|
|
Repeat after me - "future-proofing" and "maintainability". You could just use interop and cal GetModuleFileName, because that's what .Net is doing anyway...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
it is giving the path like this
C:\Inetpub\wwwroot\TestingApplication\TestingApplication\bin\Debug
but i want just my application path only like
C:\Inetpub\wwwroot\TestingApplication
so that i can hardcode myfile name and i can concatinate
like
C:\Inetpub\wwwroot\TestingApplication\myfilename.doc
|
|
|
|
|
Narendra Reddy Vajrala wrote: but i want just my application path only like
C:\Inetpub\wwwroot\TestingApplication
i think thats a bad idea
the path you want just contains your project files and stuff, the application is the important part, if you want to import files at run time you should put them in the same location as the application executable or a sub-directory of it.
though im not entirely sure what you even want to do so maybe im wrong...
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
what exactly is
to my application setup i want to add a word document(here i will give some text here)
i want to read that text in one of my form.
how can i read that text.
Please help me itz urgent
|
|
|
|
|
ok well you can look into the System.IO.StreamReader class if you file is just plain text or you can do a search for 'Word Automation with C#' and have a look at working with MS Word, but that approach can be a bit of a pain.
What format your file in, and what data do you want to get from it, give example of input format and desired output and maybe i can help further
EDIT:
Actually i just seen your repost so my help stops here
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
sure.,
Thankyou
In my application(product) i have 2 modules, by default those 2 will install at the time of installation.
for some clients we have to give single module only at that time 2nd module should be blocked.
For this what i want to do is
I want to add a file (word or txt) with TRUE or FALSE as text
in my coding i want to read that value (TRUE/FALSE)
if TRUE i will allow 2nd module otherwise i want restrict.
for this how can i get that added document path
and this document i want to add to my solution setup project.
Thanks In Advance
|
|
|
|
|
use below code u ill be geting application start up path as string
Application.StartupPath();
|
|
|
|
|
i want my application path only not startup path
|
|
|
|
|
I need to retrieve data from microsoft excel using visual c# 2005 !!!......How can i do it ?? is it possible using file objects !! I planning to make a windows application wid it
plz help !!!
|
|
|
|
|
Here[^] is the list with examples!!
Enjoy
I are troll
|
|
|
|
|
the sites u gave displays either an excel sheet or enters data into excel sheet through c#. I want to read data from excel sheets through c# and display them in "windows form ". The output should be in a simple textual way.
Can i use streams and file objects to do so ??
plz help!!!
|
|
|
|
|
That depends on the layout of the Excel-file and the version of Excel. I suggest you use ODBC to read Excel, or interop. We also got articles here on CodeProject that explain the reading;
* ODBC[^] approach
* Example using InterOp[^].
Enjoy
I are troll
|
|
|
|
|
About Remoting .Net, I want to ask you how to debug a remoting object.
Suppose I have 3 projects:
+ Project RemotingService: provide Remoting class, type Library
+ Project RemotingServer: reference to RemotingService and register it to TCP Channel.
+ Project RemotingClient: this project references to RemotingService and use classes in RemotingService
They work well but I can not debug code in RemotingService project.
Could you have any ideas to solve this problem.
|
|
|
|
|
I've never done it personally, but I've seen #if DEBUG statements in main used to compile a service as a console app in debug mode; then it can be run and debugged just like any other program.
|
|
|
|