|
Here's some sample code:
while (true)
{
SendRemaiderEmail();
}
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
I'm transmitting recorded video file over LAN using UDP but sometimes file transmit successfully and sometimes at receiving side(client) it doesn't receive properly whereas at server side I get transmitting message.
Please See my code and give me suggestion to overcome this problem.
public void filercvold()<br />
{ <br />
<br />
outStream = File.OpenWrite(filepath);<br />
bufOutStream = new BufferedStream(outStream);<br />
<br />
i=0;<br />
while (i<=fsize)
{<br />
try<br />
{<br />
<br />
<br />
idsock.ReceiveFrom(rcvfilebuf, ref idep);<br />
<br />
bufOutStream.Write(rcvfilebuf, 0, rcvfilebuf.Length);<br />
<br />
i++;<br />
<br />
}<br />
catch (SocketException ttt)<br />
{<br />
MessageBox.Show(ttt.Message);<br />
}<br />
<br />
}<br />
<br />
bufOutStream.Flush();<br />
bufOutStream.Close(); <br />
outStream.Close(); <br />
MessageBox.Show("File is completly received!!");<br />
}
//outStream is FileStream Object
//bufOutStream is BufferedStream Object
idsock is socket object
// rcvfilebuf = new byte[16384]; 16KB packet
Now whenever I got last msg "File is completly received" File fully saved and run properly. but when I dont get this msg as at server side I got transmitting msg but at same time at client side above notification doesn't show as client become stuck or remain in this statement " ReceiveFrom(rcvfilebuf, ref idep);"
Now tell me how to check this or rcv full video every time as it doesnt happen everytime.By same code I got this msg and run video file at client but by same code above problem I face so what is main reason or where I'm doing wrong.
Thanx in advance.
Regards,
Shanzay
|
|
|
|
|
Without seeing all of the related code, we probably can't help you.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi All,
According to my requirement i need to get the webpagepreview of the active word document in a new window. Can anyone help with this...
This is my code
protected Microsoft.Office.Interop.Word.ApplicationClass objWord = new ApplicationClass();
object fltDocFormat = 10;
protected object missing = System.Reflection.Missing.Value;
protected object readOnly = false;
protected object isVisible = false;
object FileName //The path where i stored the file
objWord.Documents.Open(ref FileName, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing, ref missing);
Microsoft.Office.Interop.Word.Document oDoc = objWord.ActiveDocument;
oDoc.WebPagePreview();
objWord.Quit(ref missing, ref missing, ref missing);
The preview is coming in the same window i need it in a new browser window
Plz help
|
|
|
|
|
Hi All,
I have made one Window services using C#.net.
My Problem is that i can't start service on my PC. It gives me error like this
Cannot start service WinService1 on computer '.'.
Can you please tell me why this error is occured?
Thanks,
Himal
|
|
|
|
|
See here[^]
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
thank you for your reply my problem is there i have installed service on machine but i can't start it. It gives me error that could not start service on local computer
|
|
|
|
|
1) Give us the *exact* error message you're seeing.
2) What OS are we talking about?
3) Make sure you're using the correct account to install the service.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
i have start my service via this code
System.ServiceProcess.ServiceController serviceController = new System.ServiceProcess.ServiceController(svcName);
if (serviceController.Status == ServiceControllerStatus.Stopped)
{
serviceController.MachineName = Environment.MachineName;
serviceController.ServiceName = svcName;
ConnectionOptions coOptions = new ConnectionOptions();
coOptions.Impersonation = ImpersonationLevel.Impersonate;
ManagementScope mgmtScope = new System.Management.ManagementScope(@"\\" + Environment.MachineName + @"\root\CIMV2", coOptions);
mgmtScope.Connect();
ManagementObject wmiService = new ManagementObject("Win32_Service.Name='" + svcName + "'");
ManagementBaseObject InParam = wmiService.GetMethodParameters("Change");
InParam["DesktopInteract"] = true;
ManagementBaseObject OutParam = wmiService.InvokeMethod("Change", InParam, null);
serviceController.Start();
}
and at last line i got error like this
Cannot start service Kerverus on computer 'PC3'.
and i am installing my service via administrator
|
|
|
|
|
Put a try/catch block around the whole thing and look at the exception you're getting. That should give you a hint as to what you need to do to fix it.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi i have created a URL protocol handler for my desktop application.
I want to pass values to the application and access them in my application how do i proceed.Example username password.
My protocol is
HKEY_CLASSES_ROOT
alert
(Default) = "URL:Alert Protocol"
URL Protocol = ""
DefaultIcon
(Default) = "alert.exe"
shell
open
command
(Default) = "C:\Program files\Alert\alert.exe" "%1"
|
|
|
|
|
Hi,
I have to fix an issue of a windows application. In my app I have to allow user to print report. Application should print record and each page must have 86 lines and each line consist of 134 characters. I have more then 86 records but its printing only 1 record. My code is :
PrintDialog printDialog;
PrintDocument printDocument;
for (int iCtr = 0; iCtr < intPageCount; iCtr++)
{
// this ProcessTransaction_82210() runs a COBOL program which returns formated record which
// contains 86 lines per page and each line contains 134 characters and here I am
// concatinating all the records to a string variable strPrint.
strPrint1 = ProcessTransaction.ProcessTransaction_82210(iCtr);
strPrint += strPrint1;
if (string.IsNullOrEmpty(strPrint.Trim()))
{
break;
}
}
try
{
printDialog.Document = printDocument;
printDocument.PrintPage += new PrintPageEventHandler(onPrintPage);
}
catch (Exception exc)
{
MessageBox.Show(exc.Message.ToString());
}
if (printDialog.ShowDialog() == DialogResult.OK)
{
printDocument.Print();
}
private void onPrintPage(object sender, PrintPageEventArgs e)
{
Graphics g = e.Graphics;
int x = e.MarginBounds.Left - 50;
int y = e.MarginBounds.Top - 50;
System.Drawing.Brush brush = new System.Drawing.SolidBrush(Color.Black);
try
{
g.DrawString(strPrint, new System.Drawing.Font("Courier New", 8, System.Drawing.FontStyle.Regular),brush, x, y);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
But the application is printing only 1 page. Can any one please let me know how to print same number of pages as in string/document. ProcessTransaction_82210() method also return Page nbr along with records.
we need to set e.HasMorePages = true but how to know it has more pages.
Please let me know the code how to print more nbr of pages. Its very urgent.
Best Regards,
Chandan Kumar
|
|
|
|
|
I can't actually see anything in your onPrintPage method about e.HasMorePages = true. Without this, the print will think that it has actually finished.
|
|
|
|
|
I had records which requires 2 pages to be printed , however when I pass e.HasMorePages = true; then it starts printing so many pages. it displays a dialog "printing 140 of document". how can I intimate printer that I have 2 pages to print.
Best Regards,
Chandan Kumar
|
|
|
|
|
|
Hi all,
I hope this would be the correct place to post this question, if not please advise.
I would like to know what files is required or what installation is required when using Crystal Reporting?
Many thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Hey there, which IDE are you using?
i use visual studio 2008 and there are (as far as i know) no extra files needed with your binary...
the report itself has an rpt file extention but this is the same concept as every form having is own cs file.
if your new to crystal i sugest you get a book because there arent many resources worth looking into on the net that ive found! but this all depends on the level of reports you need to create
ive just ordered this book for myself Click me[^]
good luck
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
|
Hi
I have a datatable having 10 records. I want to insert the 10 records to a table in a database using stroed procedure from my front end C#. How to do? can any one help me please?
Thanks in advance
kesavan
kesavan
|
|
|
|
|
Write a stored procedure to insert 1 row. Then call that stored procedure once for each of the rows you which to insert.
If they have to be done together, do the whole thing inside a transaction.
Simon
|
|
|
|
|
Write the stored procedure to accept an xml parameter. Send all 10 records as xml and unpack in the stored proc to insert them.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
|
Hi,
Curretly i am doing some operations on tables of oracle 9i database using oracle connections and commands by using the namespace "System.Data.OracleClient" i want to know which provider is used internally by the .Net for the database operations with this namespace and by the by client version of oracle on my system is 10g.
Thanks in Advance.
|
|
|
|
|
hi i try to add sorted field on my report in my application and find this code :
<br />
DatabaseFieldDefinition crDatabaseFieldDefinition = rp.Database.TablesItem[0].Fields[0];<br />
rp.DataDefinition.SortFields.Item[0].Field(crDatabaseFieldDefinition);<br />
it work correctly..
i try to add multiple sort field ...but in my application the crystall reportviewer only sort report on first fild...
can any one know that how i add multiple sort fields on crystal reports in my application?
thnx
|
|
|
|
|
Hello,
VS 2008
I am calling native C++ dll from C#.Net 3.5. The program works ok, and I am very new at doing this. I am just wondering if there a better method to use. I will have to make many call backs in my project from native C++. So I am looking for a efficient method to handle the call back to make it easier to maintain and add more call backs. And to call these from .net. Is there a way to have a middle layer to bridge between .Net and C++? Just guessing here.
My code is below, this is just a simple that return a int from a call back.
Many thanks,
typedef void (__stdcall *ptrToAge)(int); <br />
MOBILEDLL_API char* GetName(char* name); <br />
<br />
void GetMyAge(ptrToAge cb) <br />
{ <br />
cb(28); <br />
} <br />
<br />
private delegate void TestCallbackDelegate(); <br />
[DllImport("MobileDLL.dll")] <br />
static extern void TestCallback(TestCallbackDelegate callbackTest); <br />
<br />
void OnGetMyAge(int age) <br />
{ <br />
this.label1.Text = age.ToString(); <br />
} <br />
<br />
GetMyAge((GetMyAgeDelegate) OnGetMyAge);<br />
|
|
|
|