|
Hi!
I want to dial a number by my modem and play a voice after a person response to the call.
|
|
|
|
|
why?
Check out this thread....(not a CP thread though)
http://www.velocityreviews.com[^]
Just type dial number modem C# into google. It's quicker than posting here believe it or not.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
Hi,
(thanks for all the help in the past)
I'm trying to sort a column in a DataGridView. I know it does this automatically, but I'm trying to sort the column so that the cell containing a specific text (Exception) is always at the top.
'Exception' is does not come first alphabetically in the grid.
Is there any way of getting around this?
God Bless
Deji
|
|
|
|
|
Hi,
When i tried to serialize WinForms, i got SerializationException, Though i
the attribute [Serializable()] is added .
Please help me to serialize a form object.
With Thanks,
Sakthi.
|
|
|
|
|
Hello,
You really have to provide more information.
The exception message would be of great help.
Maybe one of the public fields in your class is not serializable.
Have you looked at the articles (like this[^]) here on the forum?
Hope it helps!
-- modified at 7:31 Wednesday 1st August, 2007
Here, an article for serializing WinForms[^]
All the best,
Martin
|
|
|
|
|
You can't serialize a winform in it's entirety because several of the Form members are not serializable.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
I am at the final stage of developing an application which allow user to create a screensaver from images(gif,bmp or jpg). The images are loaded at run-time. Now how can I integrate these as embedd in the new exe ? Is there a way I can do it ?
Currently, I am loading the images from the path. The screensaver(scr) is developed by renaming the exe file to scr and moved to windows/system32 folder. This works very fine under windows vista. However, windows xp does not display any image with this implementation. Any help here ?
Thanks.
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg."
- Bjarne Stroustrup
|
|
|
|
|
Can you not just add the picture files in the resource manager (double click the Resources.resx file) and mark them as "Embedded at runtime" (Under the "Persistance" property)?
The picture files are integrated into the .exe this way and you can call the files in your code using Properties.Resources.FileName;
Mark.
|
|
|
|
|
I am adding images at run-time. So I cannot do this since it is done at compile time.
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg."
- Bjarne Stroustrup
|
|
|
|
|
Hi
I am developing an application in ASP.net 2.0 / C# / SQL server2005.The problem is that when end user clicks on download hyperlink it downloads the entire page along with the file which needs to be downloaded.This happens only in case of .HTML extension. e.g. End user wants "a.html" page which is populated on my "xyz.aspx" page.So he click on download link to download "a.html" but ends up downloading "a.html" and "xyz.aspx"(html).
Any help will be greatly appreciated.
Waiting for positive reply.
MY CODE:
DOWNLOAD FUNCTION
private void downloadFile(string sid, string fn,string foldertype)
{
//string siteId = Session["siteid"].ToString();
//string folder = Session["foldertype"].ToString();//
if (File.Exists(Server.MapPath("~/Files/" + foldertype + "/" + sid + "/" + fn)))
{
string filepath = Server.MapPath("~/Files/" + foldertype + "/" + sid + "/" + fn);
if (fn.Substring((fn.Length - 1) - 2, 3) != "pdf")
{
System.IO.Stream iStream = null;
// Buffer to read 10K bytes in chunk:
byte[] buffer = new Byte[100000];
// Length of the file:
int length;
// Total bytes to read:
long dataToRead;
// Identify the file to download including its path.
Response.Write(filepath);
// Identify the file name.
string filename = System.IO.Path.GetFileName(filepath);
try
{
// Open the file.
iStream = new System.IO.FileStream(filepath, System.IO.FileMode.Open,
System.IO.FileAccess.Read, System.IO.FileShare.Read);
// Response .Write(iStream.
// Total bytes to read:
dataToRead = iStream.Length;
Response.Clear();
//if (fn.Substring((fn.Length - 1) - 2, 3) == "pdf")
//{
// Response.ContentType = "application/pdf";
// Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
//}
//else
//{
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
//}
// Read the bytes.
while (dataToRead > 0)
{
// Verify that the client is connected.
if (Response.IsClientConnected)
{
// Read the data in buffer.
length = iStream.Read(buffer, 0, 10000);
// Write the data to the current output stream.
Response.OutputStream.Write(buffer, 0, length);
// Flush the data to the HTML output.
Response.Flush();
buffer = new Byte[10000];
dataToRead = dataToRead - length;
}
else
{
//prevent infinite loop if user disconnects
dataToRead = -1;
}
}
}
catch (Exception ex)
{
// Trap the error, if any.
Response.Write(ex.ToString());
}
finally
{
if (iStream != null)
{
//Close the file.
iStream.Close();
}
}
}
else
{
try
{
Response.Clear();
FileStream MyFileStream = new FileStream(filepath, FileMode.Open);
long FileSize;
FileSize = MyFileStream.Length;
byte[] Buffer = new byte[(int)FileSize];
MyFileStream.Read(Buffer, 0, (int)MyFileStream.Length);
MyFileStream.Close();
Response.ContentType = "application/pdf";//octet-stream
Response.AddHeader("content-disposition", "attachment; filename=" + fn + "");
Response.BinaryWrite(Buffer);
Response.End();
}
catch (Exception ex1)
{
// Trap the error, if any.
Response.Write(ex1.ToString());
}
}
}
else
{
//lblError.Text = "Temporary file not available";
}
}
HYPERLINK CODE:
protected void filegrid_ItemCommand(object source, DataGridCommandEventArgs e)
{
try
{
MinisiteTableAdapters.FilesTableAdapter ftl = new MinisiteTableAdapters.FilesTableAdapter();
if (e.CommandName == "Download")
{
string folder = e.Item.Cells[11].Text;
downloadFile(e.Item.Cells[7].Text, e.CommandArgument.ToString(), folder);
}
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
}
RDAAC
|
|
|
|
|
Hi, i'm developing a C# windows application, my question is i have my combobox item bind from database,but how i can change my combobox item property to read only?
i've search the combobox property but there is no read only property
Regards,
Tomi
|
|
|
|
|
Hi,
You have an property named "DropDownStyle" where you can define the style/behaviour
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|
|
Oh I see..Thank for the help
Regards,
Tomi
|
|
|
|
|
I am facing problem with a Webservice. When the server runs on wired network, my webservice client can work fine. It gets proper response from server. But when i am configuring a wireless network in the server, then the client can not get any response from webservice in server.
The wireless network is set up by aircard from sprint. The webserver has anonymous access. I think it may be related to security issue. The server runs on port 82. Not on default IIS port 80. I can connect to the webservice using InternetExplorer. So it is running fine. But my client program gets no response.
Why my client program gets response in wired network, but not in wireless network. I have no clue. So please help me to sort this out.
Thanks
Chayan
|
|
|
|
|
I have a web applicaion which has database connection class. I want to create a different Windows service project which uses the same connection classes.
I do not want to make a copy of the connection class file.
My quesries are as below:
1. Please suggest the ways I can do it. [One way is to create a dll and use it]
2. Are there any pre-requisties to perform the same thing.
Pavas
|
|
|
|
|
Your two options are copy the code, and use a dll. That's about it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi,
i wanna disable Windows Xp Visual style for my program as i cant set background color of progress bar or some other component
i can do this in VB.net by just unchecked the checkbox in my project properties
but in C#, there isnt anything about it.
so some one know a good way to do it..
Becoming Programmer...
|
|
|
|
|
delete Application.EnableVisualStyles() line from Main()
life is study!!!
|
|
|
|
|
I would like to create a DLL from a c# file to reffer it to a new project.
Please suggest how can I do it.
Pavas
|
|
|
|
|
Create a new project, of type 'class library'. Copy in your code, and build.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I already have a web applicaion and the webapplicaion has the .CS file. I am looking for a command to convert the .CS file to dll and reuse it to some other project.I am using VS 2005
Pavas
|
|
|
|
|
...you have to simply:
You have to insert a new Project inside you solution(class library type).
Then insert an existing item(c# file) inside this project.
Compile.
Add a reference in your app project, and use it!!
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|
|
Thanks!
Let me explain you in detail. Sorry for not detailing u the problem
I want to create a seprate project. Ourside the solution. So there are two seprate projects [one is web project and other one is windows service].
This Web project uses a connection class. Now is it possible to reuse the same connection class with out creating a coppy of .cs file.
Pavas
|
|
|
|
|
Dagnamit it - two people have told you now. You need to create a new project and move the code into that project. It needs to be a class library. That's how you create a dll. You need to move code into the dll, for it to be there, quite plainly. If you don't create a copy of the file, how can you hope to create a dll ? You'd then remove the copy from your project, as it will get the class from the dll.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
here here, flame away!
|
|
|
|