|
guchu wrote: this.textbox1 = new system.windows.forms.textbox();
string a = textbox1.text,
A new textbox would be blank, so string a would be "", debug through your code.
I will not give you the code but go to the documentation[^] and check out the process class, specifically the start method, and search the forums a bit, you'll find your answer. You just have to research for it.
Also, I would look into the OpenFileDialog to pick your file, that way you have no restriction on the residual location of your excel files.
|
|
|
|
|
i understand that u want me to learn the easier method but even using this one i am able to open the file if i specify the file name as "C:\....\a.xls" ... all i want to know is if i want to take this last part(a.xls) from the user since the file neways has to be on the desktop then how do i accomodate it in the code ... i have tried doing it using the + operator but it is not done this way as it seems as the compiler doesnt reads the remaining thing written outside "" ... i would be obliged if u can help ... i need it desperately
|
|
|
|
|
You reset your textbox by doing Textbox1 = new System.Windows.Forms.Textbox();
if you take that out, you should be fine provided the file exists but your design is horrible, inefficient and there is a faster, prettier way of doing it.
|
|
|
|
|
I will go through the documentation and redesign the program .... i will get back to u if i have any quaries regarding this ... as of now thank you very much for helping me out ....
|
|
|
|
|
Hi,
I'm trying to download a MP3 off the internet programatically. Using the method below, my MP3 player recognizes the ID3 tag, however it won't play. Anyone know how to properly download a MP3 file that will play?
StreamReader sr = new StreamReader(WebRequest.Create(strURL).GetResponse().GetResponseStream());
FileInfo fi = new FileInfo(@"c:\news.mp3");
BinaryWriter bw = new BinaryWriter(fi.OpenWrite());
while (sr.Peek() != -1)
{
btMP3 = (byte) sr.Read( );
bw.Write(btMP3);
}
bw.Close();
Thank you,
Glenn
|
|
|
|
|
Hi,
there is a WebClient.DownloadFile() method that downloads a file much easier and more efficient than your code would.
BTW: what would happen when for some reason the data isn't arriving in time so sr.Peek() can't see the next byte?
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
i made a chat program in c# and connect it to a local access database,
can i put this database on a server on the internet so can people connect to it by the program , if i can what is the connection string?
i used this connection string to connect to access database:
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=FileName"
|
|
|
|
|
|
You will find all the possible connection stringd herehere
You will find in visual studio in the server explorer panel a property wich define your connection string...
regards
|
|
|
|
|
|
And what everybody isn't telling you is that Access is a FILE BASED, desktop database. The only way to get at that database, directly, is to expose your server's file share directly to the Internet. This is about the dumbest thing you can do. Your server will be a smoldering pile of scrap in less than 24 hours.
To insultate the server as much as possible so the idiot on the web won't destroy your server, you need to expose the methods that your chat app needs in a web service and have it do all the database work needed.
|
|
|
|
|
Hi all,
I am making use of Data block of the Enterprise Library 4.1, the problem is that each time I rebuild my application, Visual Studio overwrites the config file.
The application cannot function without these settings. How can I avoid this annoying issue?
The configuration line in question:
configSections
section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data....
configSections
dataConfiguration defaultDatabase="OraConnectionStr"
Thanks in advance.
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
I create a windows service where I implement the onStart() method, there i create i thread that opens a ServiceHost communication and write onto the base registery but it doesn't take effect, Idon't know how to give the thread the permission to write into it !
|
|
|
|
|
Open your "Control Panel", and look for the "Administrative Tools". This has an applet called "Services". Find your service in the list (should be there if it's properly installed) and double-click on it. Go to the tabpage called "Log On".
Here you can specify the account that the service should run under, and whether or not it's allowed to interact with the desktop (for, say, displaying a notification icon)
Hope this helps
I are troll
|
|
|
|
|
What account is the service running under??
|
|
|
|
|
My service runs under the "LocalSystem" accont, and I follow the quoted instructions (check the flag to give the permission to interact with the desktop ), but Regrettably the service could not write into the registery.
|
|
|
|
|
I found it !
Simply I wanted to wrote into "H_Key_Current_user" at it was impossible because the service was running under the "LocalSystem" account (not a "user" account) therefore I changed the location into "H_Key_Local_Machine" and it works very well
Thank you to all who wanted to help me
|
|
|
|
|
Dear friend
I want to make a website related to tree structure means if I generate a mail id example like rahul and ssponsored to other it means create other shyam the second id will come under my id . I want to see all it under a tree structure please advice to me how it possible.
Thanks ®ards
Akhilesh kumar
lucknow
|
|
|
|
|
www.rentacoder.com
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
The OP downvoted you and me for not doing his work. What BS that is.
|
|
|
|
|
They dont consider it as a help until you provide them with complete code which can be copy pasted
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
No, tell your client you cannot do the work.
|
|
|
|
|
Hello forum....
First of all I wanna thank you for your kind solutions for my problems.
I want to convert a string in DateTime format. The string is build in a C++ program using following code:
time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
char* str = asctime (timeinfo);
WriteFile(hLog,str, lstrlen(str), &dwDummy, NULL);
So as an output I find the following string
Tue May 26 17:48:53 2009
in a specified fie.
Now I want to read this file in a C# program. Here while reading the file how can I know that a particular line is a time stamp.
I want to convert Tue May 26 17:48:53 2009 again into DataTime format.
I'll be thankful for any kind help.
Thanks ....
Vishal Moharikar.
|
|
|
|
|
Use regular expressions to find a match
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
How on earth does that help the OP?
He is not looking for a match, he wants to convert the string to a DateTime structure.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|