|
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
|
|
|
|
|
|
ok here we go. I created a win form an in the Load event I've added this code:
private void Form1_Load(object sender, EventArgs e)
{
// Create a sample DataSet
DataSet dataSet = new DataSet("myDataSet");
DataTable dataTable = new DataTable("myTable");
dataSet.Tables.Add(dataTable);
DataColumn column = new DataColumn("firstName");
dataTable.Columns.Add(column);
column = new DataColumn("lastName");
dataTable.Columns.Add(column);
column = new DataColumn("phone");
dataTable.Columns.Add(column);
// Add some sample data
DataRow row = dataTable.NewRow();
row["firstName"] = "Joe";
row["lastName"] = "Public";
row["phone"] = "0123456789";
dataTable.Rows.Add(row);
row = dataTable.NewRow();
row["firstName"] = "Bob";
row["lastName"] = "Sugar";
row["phone"] = "9876543210";
dataTable.Rows.Add(row);
// Convert dataset to an XmlDocument (XmlDataDocument in this case
// so we can pass it the dataSet directly instead of faffing
// about with MemoryStreams / XmlWriters
XmlDataDocument xmlDataDoc = new XmlDataDocument(dataSet);
// set constraints so that we can work with the dataSet as XmlDocument
xmlDataDoc.DataSet.EnforceConstraints = false;
// Link our CSS file to the xml document by inserting a processing
// instruction
XmlProcessingInstruction p = xmlDataDoc.CreateProcessingInstruction("xml-stylesheet", "href=\"myReport.css\" type=\"text/css\"");
xmlDataDoc.InsertBefore(p, xmlDataDoc.ChildNodes[0]);
// Save the xml file
xmlDataDoc.Save("myReport2.xml");
}
I've also created this very simple css file, called it "myReport.css" and dumped it in the project debug folder:
myTable {
display: list-item;
}
firstName {
color: #0000ff;
font-family: Arial;
font-size: 10pt;
}
lastName {
color: #ff0000;
font-family: "Times New Roman";
font-size: 11pt;
}
phone {
color: #00ff00;
font-family: "Courier New";
font-size: 12pt;
}
Run that up then open the xml file, it should automatically reference the css file and do the formatting for you.
|
|
|
|
|
There's nothing wrong with using the StreamWriter to create the html report, but it may be easier with the XmlTextWriter as it is specialized on the generation of xml files and html can be regarded as a special xml grammar. As said before it frees you from generating the markup and thereby will ease your work and make it less error prone. By the way, it is not that different from the StreamWriter. Simply spoken, it only provides some more specialized Write methods. Take a look at the examples in the documentation and I'm sure you get used to it quickly.
"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
|
|
|
|
|
thanks guys
until the next problem....
Regards
Saira
|
|
|
|
|
Hello gurus,
I'd like to know if there is a class that retrieves the list of all primary languages (English, French, Spanish...) and there standard codes (0x0409 etc.)
I think there is a way to get these languages and their associated standard codes, but how???
Can someone provide me the name of the class/members or a code snipet please?
Best regards.
Fred.
There is no spoon.
|
|
|
|
|
CultureInfo.GetCultures[^]
I didn't check if there was a flag to request primary languages only, but if their isn't, just skip anything that doesn't have the neutral culture as parent.
|
|
|
|
|
Hi Friends,
Sorry for repeating this question. How to sort the datagridview unbounded columns in c#.net.Its urgent for me. Please Help.
Code:
ICollection userDetails = new ArrayList();
domainUser = SessionData.LoginName;
domainPassword = SessionData.Password;
userDetails=GetAllUsers(DEFAULTDOMAIN, domainUser, domainPassword); (Here GetAllUsers is a method which returns all the user details from the domain).
dgAddressBook.DataSource = userDetails;
Full Details are listed in Datagridview. But I need to display the records based on the Column Firstname - ascending order).
Thanks in Advance,
Regards,
Prya
|
|
|
|
|
If you are using framework 2, use a SortedList instead of ArrayList, or a List and use it's Sort method.
Otherwise, you can use the Sort method of the ArrayList.
---
Year happy = new Year(2007);
|
|
|
|
|
THank u so much. I applied it like,
ICollection userDetails = new SortedList();
But the contents are not sorted. Can u pls. suggest me what was the problem.
Regards,
Prya
|
|
|
|
|
The problem is that you are not using the list that you create in that line. The GetAllUsers method returns a new list and the first list is thrown away.
---
Year happy = new Year(2007);
|
|
|
|
|
Hi all,
I have a question that isn't possible store value/data in application instead of in database. What i mean here is even i close my application,those value which are stored/saved is still remain in my application.When next time i run again that application,the value still be the same as before.I know some functions like setting.save() ,but dun know is correct or not.
Can someone give me a hand or guide me to solve it out?any hits are welcome.
thanks in advance.
cocoonwls
|
|
|
|