|
|
I would go see your teacher, otherwise you are scuh-rewed.
|
|
|
|
|
You know its a good day when the climax to a long list of message posts ends with such a humorous response. It makes you remember why you bother reading these kind of posts in the first place.
To be slightly more constructive... choose another project!
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Requirement is like this,
Events will be present for a week.(Same like Orkut Events)
On a single day there can be more than one event at different times.
Based on user login the user should see the events,if he log's in after the scheduled event time then only "Descripition" (Database field ) of the event should be seen else Events-Name,UserName,Image will be displayed.
My problem is I need to show only 7 records all together irrespective of Number of events present for that week i.e for 7 days in a week 7 records only. In each record more than one event can be present (or) if present should be displayed .
For achiving this task I can take any of the data presentation control,but i dont seem to get any idea of solving this requirement. It would be gr8 if any one helps me out Its Urgent.Thanx In advance.
santosh
|
|
|
|
|
hi everyone,
I am facing big problem in Ftp upload function.
When I run following code for english named file uploading It's ok. No problem. But when i try for chinese named file. I got this error message.
"The remote server returned an error: (550) File unavailable (e.g., file not found, no access)."
Let me know if you have solution for me. Thanks in advance.
~~ This is my source code ~~
FtpWebRequest request = (FtpWebRequest)WebRequest.Create("XXX" + Path.GetFileName(this.txtUploadFile.Text));
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Credentials = new NetworkCredential ("XXX","XXX");
request.UseBinary = true;
request.UsePassive = false;
request.KeepAlive = false;
StreamReader sourceStream = new StreamReader(this.txtUploadFile.Text);
byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
sourceStream.Close();
request.ContentLength = fileContents.Length;
Stream requestStream = request.GetRequestStream();
requestStream.Write(fileContents, 0, fileContents.Length);
requestStream.Close();
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
Richard
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:27am.
|
|
|
|
|
Server has Simplify Chinese code GB2312 already.
Richard Htin
|
|
|
|
|
I have to load a single byte array of 64 elements.( from a USB device - which I have already done using HID examples in net)
Actually this 64 bytes is 4 groups of 16 bytes each.
I need to load this as a array of 64 bytes and process it as 4 structures of 16 bytes each.( In Microcontroller C programs I use Unions)
Which is the apt method in C#? and How?
Thanks
With Regards
Roy Thomas
"..this file is known as source file probably because it is a source of frustration and anxiety!" - Chuck Sphar - In book 'C# 2005 for Dummies'.
|
|
|
|
|
You can create a struct in C# and specify how much space each variable takes up. I forget the syntax, but I know you can.
Just found this with google:
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Explicit)]
struct ByteArray {
[FieldOffset(0)]
public byte Byte1;
[FieldOffset(1)]
public byte Byte2;
[FieldOffset(2)]
public byte Byte3;
[FieldOffset(3)]
public byte Byte4;
[FieldOffset(4)]
public byte Byte5;
[FieldOffset(5)]
public byte Byte6;
[FieldOffset(6)]
public byte Byte7;
[FieldOffset(7)]
public byte Byte8;
[FieldOffset(0)]
public int Int1;
[FieldOffset(4)]
public int Int2;
}
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I added to windows service design view a timer. I start it to say 2000ms in service custom command, and dump to log file that it was started indeed, by checking enabled property.
However, the timer event does not happen? (I dump to text file in the same way each timer tick)
I checked that in Designer.cs the timer was properly created and timer handler attached.
Is there a special timer processing in services?
Чесноков
|
|
|
|
|
The problem can be that normally a service doesn't have a window and if I'm right the normal way a timer
catches the tick event over the main window proc.
At first you can try to let your service "interact with desktop".
Second I would try to use this class instead http://msdn.microsoft.com/de-de/library/system.threading.timer.aspx.
Greetings
Covean
|
|
|
|
|
many thanks!
I will look into system.threading.timer class first
Чесноков
|
|
|
|
|
Hi,
Below code will Help you
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.Text;
using System.Timers;
using System.IO;
namespace service
{
public partial class Service1 : ServiceBase
{
Timer t = new Timer();
StreamWriter writer = new StreamWriter("C:\\Service.txt");
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
t.Elapsed += new ElapsedEventHandler(t_Elapsed);
t.Interval = 60000;
t.Enabled = true;
writer.WriteLine("Service is Started");
writer.WriteLine("Timer has been started..");
writer.Flush();
}
void t_Elapsed(object sender, ElapsedEventArgs e)
{
writer.WriteLine(DateTime.Now.ToString());
writer.Flush();
}
protected override void OnStop()
{
t.Enabled = false ;
writer.WriteLine("Service is Stopped");
writer.Flush();
}
}
}
Thanks,
Sunil G.
|
|
|
|
|
Design view? For a Service? What?
What kind of Timer? I use a System.Timers.Timer
Did you start the Timer?
|
|
|
|
|
Hi,
I am trying to access outlook application in my c# code..I am able to read all mails when I debug..but when I try to access the same using a Windows service,I can't able to access..I get the following error..
"Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005."...Can anyone help me with this..
|
|
|
|
|
I'd guess it relates to permissions on the account the service runs under.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hello ,
I am adding a header to excel using string builder as below.
StreamWriter stream = null;
try
{
string separator = " ";
int serialNumber = 1;
using (stream = new StreamWriter("c:/xyz.xls", false, Encoding.GetEncoding("Windows-1252")))
{
StringBuilder builder = new StringBuilder();
builder.AppendLine();
builder.Length = 0;
builder.Append("SerialNo.");
builder.Append(separator);
builder.Append("TimeOfValidity");
stream.WriteLine(builder.ToString());
}
}
Is theer any way I can make this bold?
Thanks
BV
|
|
|
|
|
This actually works ? Really ? Wow.
To make it bold you'd need to interact with Excel properly, and not by just appending your text to the file verbatim.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
HI
I wenet in through the article at :
http://www.dotnetspider.com/forum/ViewForum.aspx?ForumId=534[^]
and tried opening the excel application through
Excel.Application ExcelObj = new Excel.Application();
Excel.Workbook theWorkbook = ExcelObj.Workbooks.Open("C:/xyz.xls", 0, true, 5,"", "", true, Excel.XlPlatform.xlWindows, "\t", false, false,0, true);
I get the resharper error message showing "Cannot create an Instance ofthe interface "Excel.Application"
Also I can see issues for Open method and XLPlatform as it turns red
I have included in my reference COM object library named under COM tab - Microsoft Excel 12.0 Object Library.
Is there anything that I am doing wrong?
Regards
BV
|
|
|
|
|
Hi!
I'm looking for a format string (to String.Format()) which is capable of handling the following criterias:
My input is a real value like -0.00123456 or 1233456.134 etc.
I want the output in scientific representation like "-1.234560E-003".
I want the output string to ALWAYS be 14 chars long no matter what.
How does the correct format string to accomplish this look like?
I've tried "{0:E7}" for positive values and "{0:E6}" for negative values. But this doesn't cover values greater than 9.9999999E+999 and values less than 1.0E-999.
|
|
|
|
|
I suspect that means you need a great level of accuracy than C# offers. Are you using the floats, Decimals or doubles ? You may need a scientific library of some sort.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Well, the probability that I get values less than E-999 or greater than E+999 is more or less zero, but I thought that it would be cleaner if I could handle both positive and negative values with one format string.
I use doubles, but thats not carved in stone...
|
|
|
|
|
hi dudes,
i have a c# solution(windows application),when i want to deploy my project,it gathers all the application resources and needed files into one exe file named setup.exe,but the problem is that i dont want to install my application on the destination computer,i just want to run it quickly without installation,and the .net framework is already installed on the destination computer .how can i make one single exe file executable on the destination system?i dont have any problem if i have to seprate it from needed files like my access database.
i will be thankful if any of u guys can help me.
|
|
|
|
|
if it's .NET, you should be able to put it on a memory stick and run it from there.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
This is simply xcopy deployment. Just copy the files from your \bin\Release directory to a folder on the other machine, and voilà!
|
|
|
|