|
|
i want to read .ini files with c# i import
using System.Runtime.InteropServices;
and i wrote these
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section,
string key, string def, StringBuilder retVal,
int size, string filePath);
StringBuilder stb = new StringBuilder(250);
GetPrivateProfileString("HATALAR", key, "", stb, 250, "C:\\Documents and Settings\\.......");
i want to use stb it gives me no error but it can't find any thing.my path, key section are true.do i have to import something else? or what must i do?
|
|
|
|
|
There's nothing wrong with your code, I've just tried it (see below) and it works fine.
using System.Text;
using System.Runtime.InteropServices;
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section,
string key, string def, StringBuilder retVal,
int size, string filePath);
StringBuilder stb = new StringBuilder(250);
private void Form1_Load(object sender, System.EventArgs e)
{
GetPrivateProfileString("mySect", "item", "def_", stb, 250, @"c:\temp\myfile.ini");
stb = stb;
}
I set a breakpoint on the stb = stb; line, and used quick view to look at the object - my INI file data is there.
Therefore... double check the path to your INI file, double check the INI file is in the correct format. My enable files looks like this:
[mySect]
item=notDEFAULT
Hope that helps.
- Dy
|
|
|
|
|
Hi.
How can I put a file (wav file) in DB.(SQL Server 2005)
Isn't it such:
Read the file as stream and insert it in a field of type binary?
Yes?
How?
Best wishes
|
|
|
|
|
Read the data into a byte array from your stream before using it as a parameter to your stored proc / query.
Regards.
modified 17-Jul-19 21:02pm.
|
|
|
|
|
Hi,
I am trying to create a new Visual C#->ASP.NET web application project.
I am getting the error:
"Project "Webapplication1" could not be opened because the Microsoft Visual C#.Net compiler could not be created. Loading the .projdata file failed or the disk is full".
I googled the error and reinstalled .net framework and VS.NET 2003. but it is of no use, still i face the same problem.
Thanks
|
|
|
|
|
Please check the following code:
string myHost = System.Net.Dns.GetHostName();
IPHostEntry localhost = Dns.Resolve("localhost");
client.LocalIPEndPoint = new IPEndPoint(System.Net.Dns.GetHostByName(myHost).AddressList[0], 5060);
Is it ok if I use the above code for Windows Mobile Application , VS 2005.
Right now i am testing with emulator causing problem to register with SIP Server.
Please give the solution.
|
|
|
|
|
It's pretty unlikely that your DNS server(s) will actually have an entry for your hostname, so that's likely to be why it's failing.
If you don't care which network interface gets used, I'd just use IPAddress.Any.
Windows Mobile 5.0 adds something called the AutoBind Layered Service Provider which automatically binds a socket with 'any' specified to the network interface that the Connection Manager picked for it. See here[^] for more details (sorry, it's a blog post, there doesn't seem to be any proper documentation on this). In my own testing I found that this does not rebind the socket if the local address changes, for example if a GPRS or other packet radio-type connection drops and is reconnected; in this situation you have to close and reopen the socket.
|
|
|
|
|
Hello,
is it possible to display a Form on a client? I have a client which makes an remote call on the server and in some cases the server want to display an dialog.
Regards
Hansjörg
|
|
|
|
|
hi all,
i have a datagridview with two columns(name and surname).
and i have two string values that hold these datas(name and surname).
how can i add these into my datagridview?
string[] mydata = new string[2];
mydata[0] = "mehmet fatih";
mydata[1] = "akbulut";
System.Windows.Forms.DataGridViewCell mydatacell = new DataGridViewCell(mydata);
dataGridView6.Rows[i].Cells.Add(mydatacell);
there is something wrong with the bold part
dont know howto fix
thanks in advance,
bye.
|
|
|
|
|
No need to create cell.
Mehmet Fatih Akbulut wrote: System.Windows.Forms.DataGridViewCell mydatacell = new DataGridViewCell(mydata);
dataGridView6.Rows[i].Cells.Add(mydatacell);
Instead of the above, simply use this:
datagridview.Rows.Add(mydata);
Mehmet Fatih Akbulut wrote: datas(
Data is a plural word and its singular is Datum. There is no word such like datas
Regards.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
i need help and clarification about : display images in crystal reports 8.5 by the physical path that saved in sql 2005database table , which must change record-by-record
thanks for help
|
|
|
|
|
I'm trying to use DLL created in visualC#.net2005 in Crystal Report ...
How can i do that ?
thanks for help
bahaa
|
|
|
|
|
Please keep your question in 1 thread....!!
|
|
|
|
|
Can Any One Tell Me How To Draw A Pixel in Asp.Net And C# Web Application.
I Have Done Graphics Programming In C ,So Know The Concepts Of Computer Graphics But Am New In Web Programming.Please Prvide Me The Functions with The Name Of Related Namespaces from Which I Can Do It...
Anand Tripathi
|
|
|
|
|
There is a data grid and I have entered data into datagrid.So I want to store these in a database table .How can I do it.
This is very Argent
|
|
|
|
|
you have to add code on click of save button
in this code ypou will traverse all the rows one by one and will save data of each row one by one.
or you can first take data to save in a string for each row data will be comma seperated and rows will be semicolon seperated and at the time of saving you can get sepearate them and then save one row each time.
|
|
|
|
|
how to delete the text file contents using C#
minchoo
|
|
|
|
|
Two options (presuming you want a blank file and not a non-existant file).
You can delete the file using System.IO.File.Delete (or maybe it's remove) and then recreate it using System.IO.File.WriteAllText(filename, "")
You can open the file for writing and not write anything to it (just don't open it for appending).
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Im developing an appliction in C# 2.0.consider a situation in which there are multiple projects in a solution and one project's dll(which v get after compiling it) is refrenced by other projects in that solution.All the build information of a project is present in .csproj file of that proj for compilation of project.In the situation, mentioned above,as there is dependency of all other projects on the dll of another project in the same solution,in this case there is a tag in .csproj file with the name <projectreference> that contains path info of refered dll.
But if a project has the reference of the dll that is not in the same solution,then in this case path of that dll is present in the tag <hintpath> instead of <projectreference> in .csproj file of that project.so now i have to ask that am i right?i mean that whether i have extracted this information rightly.if not then plz can u tell what in actual happens because this information is requred in one of my applications,thanks
|
|
|
|
|
Um, if I managed to read that correctly then yes you have extracted the correct information. I think, you might want to explain a bit clearer with a few short examples in future.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Hi all,
i have downloaded a chat application from http://www.codeproject.com/useritems/Instant_Messenger.asp
Now i want to add the text formatting for the messages.
Formatting such as Bold, Italics, Underline and Color, Font changes etc.
I tried by using RichtextBox but i am not able to send and receive messges.
Anyone please help me out...
Thanks & Regards,
Pramod
|
|
|
|
|
Yadav Pramod wrote: I tried by using RichtextBox but i am not able to send and receive messges.
Hello Yadav,
Have u send/receive Text or Rtf?
regards,
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
i send the RTF of the richtextbox,
but when i receive the message and try to append the received string to the rtf of the richtextbox by richtextbox1.Rtf += receivedMsg;
here receivedMsg is the rtf that the client has sent.
but the above line does not append the message to the richtextbox.
Thanks,
Pramod
|
|
|
|
|
Yadav Pramod wrote: richtextbox1.Rtf += receivedMsg;
Do not do like this.
Make sure caret are at the end of RTxtBox. & use
richtextbox1.SelectedRtf = receivedMsg;
It will insert text where the caret is.
|
|
|
|