|
OOP is the same, no matter what the language. I'm sure google is teeming with information, but I'd recommend buying a good book and working through it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Could you please recommend one or two.
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Hi,
Can any one help me to build a listview control where i can add two check box in the last right column of listview.
Please help me.
THanks
Biswabhusan
|
|
|
|
|
Hi,
I have a class that has a string attribute.
I set this attribute to " " (a space) and serialize the instance to an xml file. When I deserialize that instance the value of that string attribute is null, not space..
How can I do that??
public class MyClass
{
private string str;
public string Str
{
get{return str;}
set{str = value;}
}
}
[STAThread]
static void Main(string[] args)
{
MyClass mycls = new MyClass();
mycls.Str = " ";
TextWriter tw = new StreamWriter("str.xml");
XmlSerializer sr = new XmlSerializer(typeof(MyClass));
sr.Serialize(tw, mycls);
tw.Close();
FileStream fs = new FileStream("str.xml", FileMode.Open);
XmlSerializer sr2 = new XmlSerializer(typeof(MyClass));
MyClass mycls2 = (MyClass)sr2.Deserialize(fs);
fs.Close();
Console.WriteLine("***" + mycls2.Str + "***" );
}
output: ******
|
|
|
|
|
Try this out!!!
. . .
FileStream fs = new FileStream("str.xml", FileMode.Open);
XmlTextReader reader = new XmlTextReader(fs);
XmlSerializer sr2 = new XmlSerializer(typeof(MyClass));
MyClass mycls2 = (MyClass)sr2.Deserialize(reader);
. . .
|
|
|
|
|
Hai Guys,
Do you know how to read the attribute value of an element in xml using c# dataset and tables.
Explanation with example will be appreciated.
Thanks.
VijayaRam
|
|
|
|
|
Is there any way we can show embedded flash content in a webBrowser control? and is there any way of doing this without the flash player installed? Thanks in advance.
|
|
|
|
|
Hai Guys,
I have problem in localizing my application to some other language such as japanese, chinese,etc.
Your Ideas about implementing localisation in c# windows application is welcomed and appreciated.
VijayaRam
|
|
|
|
|
Please share your problem.
Regards,
Bhupi Bhai.
|
|
|
|
|
Hi,
To implement the localization we need to do
1) Create .resx file for each language.
2) Generate .resource file from the .resx file using resgen tool.
3) Create the ResourceManger in your application.
4) The .resx files store the language strings as key value. So read the language string using the Getstring method of ResourceManager passig key value as input parameter.
Guess this will help you.
Pani
|
|
|
|
|
Thanks for your idea,
But can you ellborate your points in details for clear understanding.
if possible can you provide Sample codes, it will be useful.
Thanks & Regards,
VijayaRam
|
|
|
|
|
our website is being hosted by some other people sir
and now i have changed write permission and i updated on the webserver
still the same problem is coming
do i need to publish my site once again and update all of the files or
only the databasse file has to replaced sir
how can i change write permission to mdb file programatically
thanking u bye
|
|
|
|
|
Hello,
I want to know how we transfer file or send file to another ..
like if client want to send file on server,, what i will do in C# for this
Thankyou
|
|
|
|
|
Have a look at the System.Net namespace.
Search on:
WebClient
HttpWebRequest
|
|
|
|
|
Hello ,
Pls clerify that which kind of transfering you would like......
bye Stateless ( HTTP )
or Statefull ( FTP ).
It's both way you can transfer file from 1 end to another end.
Keep Smiling !!!
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|
|
Hi,
I need to pass a relativly complicated struct into a dll calling a CORBA Service which has to be written in vc6.0 and it has to contain many elements which are necessary to create an input for a service.
Unfortunately I can see only the first array element, other are ignored.
Here an example of c# code:
<br />
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]<br />
public struct MyStrStruct3<br />
{<br />
public string FirstName;<br />
public string FamilyName;<br />
public int size;<br />
}<br />
<br />
[DllImport(@"C:\Projects\CorbaLib60\Debug\CorbaLib.dll")]<br />
private static extern int TestMe(ref MyStrStruct3[] pstr);<br />
<br />
MyStrStruct3[] Names = new MyStrStruct3[2];<br />
Names[0].FamilyName = "Konieczny";<br />
Names[0].FirstName = "Marek";<br />
Names[0].size = 3;<br />
Names[1].FamilyName = "OtherName";<br />
Names[1].FirstName = "OtherFirst";<br />
Names[1].size = 2;<br />
int miki1 = TestMe(ref Names);<br />
C++ code look like this:
<br />
typedef struct _MyStruct2<br />
{<br />
char* FirstName;<br />
char* FamilyName;<br />
UINT size; <br />
} MyStruct2;<br />
<br />
<br />
int TestMe(MyStruct2* pStruct[])<br />
{ <br />
int Size = 2;<br />
<br />
for (int i=0; i<Size; i++ )<br />
{<br />
int woofie = pStruct[i]->size;<br />
char* miki = pStruct[i]->FamilyName;<br />
char* miki1 = pStruct[i]->FirstName;<br />
}<br />
return 42;<br />
}<br />
I define export :
<br />
<br />
__declspec(dllexport) int TestMe(MyStruct2* pStruct[2]);<br />
<br />
It works, but only for first element. I also have tried to pass it as
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]<br />
public struct MyStrStruct4<br />
{<br />
public MyStrStruct3[] Names;<br />
public int size;<br />
}
but it doesn't work and raise an exception.
Marek
|
|
|
|
|
hi people i want to create a reportthrough my code. i'm using VS.Net 2003.
i have already wrote some code files on a specified location through the StreamWriter class using the following code:
string filepath = File_Path + Path.DirectorySeparatorChar + "AssemblyInfo.cs";<br />
<br />
using (StreamWriter sw = new StreamWriter(filepath))
"AssemblyInfo.cs" is the name of the file that i have created.
filepath tells the location on which to create this file.
now i want to know that how i can write on an Html page that i have added to my VS project.
can anyone help me??
Regards
|
|
|
|
|
There many ways but I might approach like this:
void WriteHtmlFile(string filepath)
{
using (StreamWriter sw = new StreamWriter(filepath))
{
try
{
sw.WriteLine("<html>");
WriteHtmlHeader(sw);
WriteHtmlBody(sw);
sw.WriteLine("</html>");
}
catch (Exception ex)
{
// handle exception
}
finally
{
sw.Close();
}
}
}
void WriteHtmlHeader(StreamWriter sw)
{
sw.WriteLine("</head>");
// Write title, other meta-data, etc
sw.WriteLine("</head>");
}
void WriteHtmlBody(StreamWriter sw)
{
sw.WriteLine("<body>");
WriteHtmlContent(sw);
sw.WriteLine("</body>");
}
void WriteHtmlContent(StreamWriter sw)
{
// content goes here
}
|
|
|
|
|
thanks for the idea.
can u also tell me how to specify the filepath and how to exactly tell the StremWriter class to write on the Html page provided, cause before now i only gave the location and the file extension and the class wrote the file on the location specified.
Regards
|
|
|
|
|
You can't write "on" an existing file. If you wan't to add content to an existing html file, you have to read the file, add the content at the correct position in the string, then write the resulting string back to the file.
---
Year happy = new Year(2007);
|
|
|
|
|
Yes, if the file already exists do what Guffa says if using StreamWriter. Stefan's suggestion of XmlTextWriter / XmlDocument will probably be easier if the xhtml is 'valid'.
|
|
|
|
|
Just to clarify things: Do you want to change an existing html file (add some content, ..) or do you want to create a new html file?
In case of the latter I suggest using the XmlTextWriter because it creates nice XHTML and thereby frees you from generating the markup (brackets and so on). If you want to change an existing html file, things are more complicated. If the file is valid XHTML your best bet would be the XmlDocument .
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
As i'm trying to create my own Report, i thought i could create a blank html page in my project and use it to create different html based reports and i want to use the StreamWriter class.
is it the right approach to create the report or should i rather use Xml instead cause i have to create the report and display the record of a table in the database.
|
|
|
|
|
I think you may be better off using true xml as output and use css for formatting to the end-user. Then all you would do is create css files for all your report types and all you would need to worry about in-code would be outputting the 'real' data to xml.
If you have your data in a DataSet and you can make your CSS fit then it may even be as simple as Serialization eg.
myDataSet.WriteXml(filepath);
Job done.
-- modified at 4:45 Tuesday 23rd January, 2007
|
|
|
|
|
can u suggest any startups on that??
regards
Saira
|
|
|
|