|
Why Not.....
I solved it as i add COM reference Microsoft word 12.0 Object Library.
Then i code this..
try
{
string Msfilename = System.Windows.Forms.Application.StartupPath;
Msfilename = Msfilename + "\\File\\Test.doc";
System.Diagnostics.Process.Start(Msfilename);
}
catch (Win32Exception ex)
{
MessageBox.Show(ex.Message);
}
I got the solution.
|
|
|
|
|
I have a file that I want to read, it's an RTF. I do this:
System.IO.FileStream fStream = new System.IO.FileStream(fileName, System.IO.FileMode.Open);
( I need a stream to pass to the WPF Rich Text control ). This fails with a permissions error, no matter where in the file system the file is. Any suggestions on how to make Vista work ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
This is real pain. Is it possible to put the file under users folder (users\user name\application data )? I am able to reproduce your issue on my Vista Business and it got solved when I moved the file to the above said directory. Environment.GetFolderPath can be used to get the path.
I have heard about creating manifest files. I haven't tried it yet. Here[^] is the MSDN article for that.
|
|
|
|
|
We have 750 MB of data, I don't want that to be stored per user.
What I found was that File.ReadAllBytes works fine for the same files, and then I can put the bytes into a memory stream. Which, I'm sure you'll agree, is not buggy at all.....
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Christian Graus wrote: What I found was that File.ReadAllBytes works fine for the same files
I was not aware. Glad to hear problem is sorted.
|
|
|
|
|
Christian Graus wrote: I found was that File.ReadAllBytes works fine
Interesting - bookmarked!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
DaveyM69 wrote: Interesting - bookmarked!
damn...I never noticed that message can be bookmarked...thanks man
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi Christian,
from the statement System.IO.FileStream fStream = new System.IO.FileStream(fileName, System.IO.FileMode.Open); Windows does not know whether you will want to read and/or write, hence you may get a File Access Denied situation depending on exact file location.
Try adding System.IO.FileAccess.Read as an extra parameter.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I want to modify windows media player SDK using c# code please anybody can help me in this regard.
|
|
|
|
|
Perhaps you need to reword your question so that it might perhaps indicate something that is physically possible. What do you want to achieve ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hello every one!
I need help with showing dynamic images in my ListView. My ListView has two colums, ImageColum and TittleColum.
I want to display only images dynamic on ImageColum as item without any textstring. TittleColum I want to diplay tittle from my custom objects as subitem.
Could any of you please give me some advices or know where I can get some code eksample in C#?? Many thanks in advance!!
regards
|
|
|
|
|
here you go
ListView with Image on SubItems[^]
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
|
Hi Guys,
When we open Microsoft Visual Studio.NET 2005, on the left side of the Start Page, we can see the content of links that are available. Similarly, in the case of Windows Application, is it possible for us to display a webpage or its contents within a Text Box or a Rich Text Box?
Your help will be appreciated,
thanx,
Rajdeep.NET
|
|
|
|
|
Perhaps you're looking to either use a web browser control on your form to display the contents of a page, or something like an HttpWebRequest to get the raw contents of a page or an RSS feed?
|
|
|
|
|
Hello! I am writing a Windows service that requires various user-defined settings in order to work. The solution uses multiple class libraries which are all linked with these user-defined settings. A coworker suggested that I use a dataset to do this, but being new to C#, I'm not exactly sure how I would go about doing this. I think I get the concept of a dataset, but I don't particularly understand how the service would know that the settings were changed after the service has been built, installed, and started. The searches I've done today haven't really given me any relevant information, and I was hoping that somebody could point me in the right direction with a source or suggestion? Any help would be greatly appreciated
|
|
|
|
|
|
The standard methodology for application settings since .Net 2.0 is pretty good. There are several good articles on their use here on CP, search on 'User Settings' or 'Application Settings'. Also check out the MSDN entries on the same topics, V.G.
However, I have little experience with Windows services, and am not aware of how they interact with either datasets or application settings files.
Whatever approach you take remember that a dataset is an in-memory representation of data, which can incidentally be read from a database or an XML file (Application Settings == *.config == XML). I would have thought that keeping the memory footprint down would be a good idea for a Windows Service.
Sorry I cannot be of more help, but hope this gives you some ideas.
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.”
|
|
|
|
|
Thank you both for your responses. The resources and general information you gave will keep me busy and are a great starting point. Thanks so much!
|
|
|
|
|
|
I dont understand what exactly you're trying to do but it little bit seems to be as I've done this earlier. It would be best if you show a picture of what you want.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
|
|
<blockquote class="FQ"><div class="FQA">myventsi wrote:</div>create a table </blockquote>
The first thing to do is to open a connection to the database.
Using that connection, you create your table. See http://www.w3schools.com/sql/sql_create_table.asp[^] for how to do that using SQL.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
hi im doing a small project for friend.. i need to get the data out of xml so that i can verify the username and password
xml is like this
PLEASE HELP THE ERROR I GET IS EXPLAINED IN THE MIDDLE.. THANKS ALOTTTT
<clientlogind>
<client username="faizych">
Password="pass"
/>
<client username="taha89">
Password="pass78"
/>
and to get the value im doing
private void button1_Click(object sender, EventArgs e)
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load("path.xml");
System.Xml.XmlNodeList client;
XmlNode clientNode = xmldoc.DocumentElement;
client = clientNode.SelectNodes("Client");
string Usernamttext = txtUsername.Text;
string passwordtext = txtpassword.Text;
foreach (XmlNode DataNode in client)
{
string userid;
string password;
************************************************************************************************
******* ERROR HERE*** now when i run it it gives me an error when it gets to the line below that """object reference not set to an instance of an object"""
*************************************************************************************************
userid = DataNode.SelectSingleNode("Username").InnerText.Trim();
password = DataNode.SelectSingleNode("password").InnerText.Trim();
if (string.Compare(Usernamttext, userid) == 0)
{
if (string.Compare(passwordtext, password) == 0)
{
break;
UserProfile UserProfileForm = new UserProfile();
UserProfileForm.usernamevalue = userid;
UserProfileForm.Show();
this.Close();
}
else
{
MessageBox.Show("Invalid Username or password");
}
}
}
}
|
|
|
|