|
If the file extensio is rtf open it in richtextbox if doc i don not know
but you can use Word object in your.net application
MCAD
|
|
|
|
|
Dear all
i do programming in a desktop application that puts html file on the desktop as a background and rearrange desktop icons and adjust the list view of the desktop and others...
after searching the internet , i found that the only way is to use the IActiveDesktop interface.
so my question is how to implement IActiveDesktop interface in C#?
thx all
|
|
|
|
|
|
I need a way of creating a table insinde an Access database if that's possible using a command or some equal structure ?? Does anybody know how to achieve this ? Or into an MySQL database ?
Lazar Mihai
|
|
|
|
|
Check out the "create table" command in SQL.
---
b { font-weight: normal; }
|
|
|
|
|
I wish to know why OpenFile and SaveFile dialogs change the current directory.
And if there si a way to prevent this, or shoud I use the following methond : Directory.SetCurrentDirectory( path );
This is what I curently use, and wanted to know if there is some other way.
Lazar Mihai
|
|
|
|
|
That's how they are expected to behave. Instead of using CurrentDirectory, you can try using System.AppDomain.CurrentDomain.ApplicationDirectory or something similar.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Your code really shouldn't be depending on the current directory anyway. The general rule-of-thumb in programming is assume nothing!. What this means is you never assume that the file you want to access is in the current directory. Always use fully qualified path names and not just a filename when doing any kind of file access.
This also has other benefits. Say you put up a OpenFileDialog that changed the current directory. After the user picks a file, you try and put the current directory back to what it was. But, your code crashes, for whatever reason, before that can happen! The function ends up returning as failed, but not having restored the current directory. Now what? Your next file access is assuming (there's that word again ) the current directory is correct when it's not, and your app ends up crashing a second time, then a third, forth, fifth, ...
Write your code so it defends itself against itself. Never assume anything is what you expect it to be.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 16:07 Monday 12th September, 2005
|
|
|
|
|
Use this:
<br />
System.Windows.Forms.OpenFileDialog dlgOpenFile = new System.Windows.Forms.OpenFileDialog();<br />
...<br />
dlgOpenFile.RestoreDirectory = true;<br />
DialogResult res = dlgOpenFile.ShowDialog();<br />
But listen to dave's answer, he is totaly right about assuming paths.
|
|
|
|
|
Hey,
Can anyone help me migrating the following struct to C# ? The problem is, that I don`t know how to migrate the union section inside of the struct.
<br />
typedef struct _IMAGE_SECTION_HEADER { BYTE Name[IMAGE_SIZEOF_SHORT_NAME]; union { DWORD PhysicalAddress; DWORD VirtualSize; } Misc; DWORD VirtualAddress; DWORD SizeOfRawData; DWORD PointerToRawData; DWORD PointerToRelocations; DWORD PointerToLinenumbers; WORD NumberOfRelocations; WORD NumberOfLinenumbers; DWORD Characteristics;<br />
} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;<br />
Thanks,
Tom
|
|
|
|
|
Tom,
You would do this
[StructLayout(LayoutKind.Explicit)]<br />
public struct _IMAGE_SECTION_HEADER<br />
{<br />
[FieldOffset(0)]<br />
[MarshalAs(UnmanagedType.ByValArray, SizeConst = IMAGE_SIZEOF_SHORT_NAME)]<br />
public byte[] Name;<br />
<br />
[FieldOffset(IMAGE_SIZEOF_SHORT_NAME)]<br />
public int PhysicalAddress;<br />
<br />
[FieldOffset(IMAGE_SIZEOF_SHORT_NAME)]<br />
public int VirtualSize;<br />
<br />
...<br />
<br />
}
You basically put the members of the union at the same offset in the structure.
I hope this helps.
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|
|
|
sahithya harsha wrote:
STEGANOGRAPHY USING AUDIO FORMAT
sahithya harsha wrote:
i don hav enough idea in c# and am doing self study now.
sahithya harsha wrote:
having my review in two days i gotto show somethng
TWO DAYS?! If you have very little experience in C#, you're going to find this project impossible in the time frame you have. You have to be comfortable with the language before you start a project of this complexity.
You have such a limited time to learn the language, the data formats for any audio file format, what is acceptable to do in that format and what is not, the implementation in code of your algorithms, ..., the only things your going to show at this review is how you've learned how to bite off more that you can chew and what the consequences are.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Let me get this straight. You got the code for this off of this site. You have one month before you have to turn it in. The code you have is part of a 15 part series of articles on stenography. Your best source for information about the code is Corinna John. Afterall, she wrote it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
i need urhent response
Is there any other way to get HTTP Headers in C# by not using HttpWebRequest and Response Calssess i mean through xml or sockets
if yes
please tell me with code or refrence to code
Thanks
in Advacne
TaRiQ
|
|
|
|
|
What's wrong with a WebRequest?
---
b { font-weight: normal; }
|
|
|
|
|
i m preparing a Request using WebRequest but cant find proper response
thats why i want to use another way to get the response
please tell me in deatail
Thanks
Tariq
TaRiQ
|
|
|
|
|
Hi all !
I have built a .dll in VC++. Now I continute develope it in C#. So I reused dll in C#. But when I using Thread that used this dll, I allway meet a problem : Only Thread using dll in a time. How to using dll for all Thread. Pls help me!
Thank alots !
|
|
|
|
|
Hi,
Lots of code around for capturing a window. But they all suffer from one deficiency.
If another window overlaps the one being captured it becomes part of the capture.
Is there a way to capture a window without bringing to the front of the desktop first (i.e. not using BringWindowToTop)?
Thank you, Jesper
|
|
|
|
|
Create a bitmap or metafile DC and send a WM_PRINT message to the window.
This way, you're not capturing the screen image, you're telling the window to draw itself on your bitmap.
The problem with this approach is that not all windows honor the WM_PRINT message. The .NET framework have a few controls that simply don't draw themselves when you send a WM_PRINT.
I see dead pixels
Yes, even I am blogging now!
|
|
|
|
|
string sInsert = "insert into temp11 values ('This is my test data's ')";<br />
SqlConnection sqlcon = new SqlConnection(ConfigurationSettings.AppSettings["DBConnection"]);<br />
sqlcon.Open();<br />
SqlCommand objcmd = new SqlCommand(sInsert,sqlcon);<br />
objcmd.ExecuteNonQuery();
IT failed becuase there is an "'" inside the text.
I tried to used
sInsert = sInsert.Replace("'","''"); but still failed.
|
|
|
|
|
Try
string sInsert = "insert into temp11 values ('This is my test data''s ')";
|
|
|
|
|
You should use parameterized queries to do this.
They are far less prone to SQL injection attacks and don't have problems with special characters inside your query strings, too.
Regards,
mav
|
|
|
|
|
Hi,
I know vertical length,horizontal length and sweep angle. with these inputs i am calculating radius,height and chordlength. But i am not able to fix Rectangle co-ordinates (assuming x=100, y=250).
My calculation is this:
p1 = x- (r+length/2);
p2= y - (r + length/2
p3 = r * 2;
p4= r * 2;
But this is not working
Can any one help me.
Regards,
-- modified at 5:52 Monday 12th September, 2005
|
|
|
|