|
Rafferty Uy wrote:
It's okay to concurrently access a file as long as it's only being read right?
This is generally true. However keep in mind that you'll never know in advance what other running processes might do with the file you want to read. If the file has already been opened without the FileShare.Read flag set you will get an exception. Also you might want to set specific FileShare [^] flags yourself when you open the file (for example to prevent that another process writes to the file while you're reading it).
Best regards
Dennis
|
|
|
|
|
Hm.. things are getting complicated, because I'm going to access the file using DTS in SQL Server. And come to think of it, I might be renaming the file somewhere along the way. uhh.. haha I think I need to detail the design a bit more.
Thanks for the tip!
Rafferty
|
|
|
|
|
A neural network that composes music or a batch creator. if you have your own ideas post 'em up.
IM PROUD TO BE A GMAIL;
|
|
|
|
|
in case of more scientific, i think the neural network would be more scientific...
btw : wats the meaning of -> IM PROUD TO BE A GMAIL;
"Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
|
|
|
|
|
|
I guess I'm not the only one who always thought that the .NET Framework 1.x collections were lacking of some useful features. Implementing the version 2 collections with generics made them more flexible and easier to use. However one might still miss some features.
It is the intention of the Power Collections open/shared source project to furthermore close the gap in the list of features with additional collection classes written in C#. The project is co-sponsored by Microsoft and Wintellect and led by Peter Golde[^]. Developers are welcome to participate as it is still in progress and not even the specification has been finalized yet.
Power Collections Project Homepage[^]
MSDN Community Center (CodeWise): Power Collections[^]
Best regards
Dennis
|
|
|
|
|
Hi,
i am working on a network project and i need to control the noise rate , thats to calculate the data transfare rate in the connection in different noise rates !
can that be done ?!
|
|
|
|
|
I'm using the MOOL to send e-mails and scan the inbox. The one thing i can't see is how to get the e-mail address of the sender from an Inbox message.
I'm able to successfully get a MailItem for each e-mail in the inbox, but the Sender Property has the "Friendly Name" not the e-mail address of the sender. I've got to be missing something obvious. Any help out there ?
App = new Outlook.Application();
oNS = App.GetNamespace("MAPI");
oNS.Logon(Missing.Value,Missing.Value,false,true);
Inbox = oNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);
Outlook._MailItem Msg = (Outlook._MailItem)Inbox.Items.GetFirst();
Email = Msg.Sender;
Well I found my own answer. I'm sure this has been posted before, but just in case:
App = new Outlook.Application();
oNS = App.GetNamespace("MAPI");
oNS.Logon(Missing.Value,Missing.Value,false,true);
Inbox = oNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);
Outlook._MailItem Msg = (Outlook._MailItem)Inbox.Items.GetFirst();
Outlook._MailItem ReplyMsg = Msg.Reply();
string Email = ReplyMsg.Recipients.Item(1).Address;
|
|
|
|
|
Seems that no matter what I try, I cannot get my bulk load to work. According to different info I've found around the internet that if you get this message:
QueryInterface for interface Interop.SQLXMLBULKLOADLib.ISQLXMLBulkLoad failed.
then you need to add [STAThread] to your code to ensure that it runs in a single threaded environment. I have done this and it doesn't work.
I've also read that if you're getting this message, it means it can't find the assembly you're looking for. I have registered my assembly with RegAsm and with gacutil and that doesn't help either. What else is there?
Here is my setup. I am using a vbscript to intantiate a COM+ component I created using C#. That instantiation is successful. That component processes my data and creates an XML file. It then uses the Interop.SQLXMLBULKLOADLib library to bulk load my xml file into the DB. When it goes to create the Interop.SQLXMLBULKLOADLib object I get the error message mentioned above.
Any suggestions?
Thanks.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
What is the recommended way to sort arrays of objects in multiple ways in C#?
For example, given an array of employee data objects you might want to sort this array by
> employee name
> salary
> employment date
> employment date, then salary
at different places in your application.
Paul
|
|
|
|
|
Hi,
If its not expensive to use a DataTable,
DataTable has a static Sort() method and you can do all these by using thaty method.
For two criterial sorts , you can call it again in the first modified table.
|
|
|
|
|
Create several classes (or a single one, with all the features you need) which implement IComparer. When you call Array.Sort, pass an instance of this class as the second parameter.
Yes, even I am blogging now!
|
|
|
|
|
I keep getting the error:
dllnotfoundexception: unable to load DLL "getString.dll"
please help me
I wrote a simple DLL in Borland C++ Builder 3 as following
getString.dll
char* tmp="Welcome";
extern "C" __declspec(dllexport) String getST();
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
{
return 1;
}
String getST() {
return tmp;
}
now i wanna use that dll file. I copy the file over to my C# project\Debug folder (because i run it with debug mode)
[DllImport("getString.dll", ExactSpelling = true, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
public static extern string getST();
public MainWin()
{
InitializeComponent();
try
{
this.Text = getST(); //<--- here
}
catch (DllNotFoundException e)
{
MessageBox.Show(e.ToString(), "error");
}
Elapid For The Win
|
|
|
|
|
Strange, I just did the same thing and it works for me.
[EDIT]
On second thought, I am not aware of how Borland handles their data type String. This is what my sample C++ code looked like:
#include "stdafx.h"
char* name = "Nick";
extern "C" __declspec(dllexport) char* getName();
BOOL APIENTRY DllMain(HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved)
{
return TRUE;
}
char* getName()
{
return name;
}
I realize your having a problem find the actual .dll itself, but I just wanted to note the difference.
[/EDIT]
- Nick Parker My Blog | My Articles
|
|
|
|
|
actually I found out what the problem was..
I didnt get the name right.. becaus when i compile it, it added a _ infront of the function's name.
Thanks Nick
|
|
|
|
|
Hi, I'd like to Start an application minimized, but it doesn't seem to work...
I override my Form's Load event and add in it:
Hide();<br />
WindowState = FormWindowState.Minimized;
What should I do instead of this?
Thanks!
|
|
|
|
|
Try to make initialization in the constructor. Mine works like that.
Why do you use hide?
|
|
|
|
|
Ok thanks...!
I used hide to remove the app from the taskbar so there would only be my NotifyIcon in the icon tray. However, I have to use the Hide() in the Load method.
|
|
|
|
|
This works for me
public Form1()
{
InitializeComponent();
this.WindowState = FormWindowState.Minimized;
}
|
|
|
|
|
Plz help me~ How do i write the code , when i click on a cmdButton it will create a pictureBox and the pictureBox will start moving. The more i click on the cmdButton the more pictureBox that move will be created.
|
|
|
|
|
Set the Visible property of your PictureBox to false. When you click your button you can check to see if the PictureBox is visible, if not, set it to true. You can move the PictureBox by settings it's Location property, which itself is just a Point .
- Nick Parker My Blog | My Articles
|
|
|
|
|
but how to create a pictureBox when i click the cmdButton, like if i click 20 times 20 pictureBox will be created and start moving.
|
|
|
|
|
DrownFish45 wrote:
but how to create a pictureBox when i click the cmdButton, like if i click 20 times 20 pictureBox will be created and start moving.
No, you aren't going to create the PictureBox within the click event handler of the button, just check to see if it's already visible. An example:
class test : System.Windows.Forms.Form
{
private PictureBox pb;
private Button b;
public test()
{
pb = new PictureBox();
pb.Visible = false;
b = new Button();
b.Text = "Click Me";
b.Click += new EventHandler(bClick);
this.Controls.Add(pb);
this.Controls.Add(b);
}
public static void Main()
{
Application.Run(new test());
}
private void bClick(object sender, EventArgs e)
{
if(!pb.Visible)
pb.Visible = true;
}
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
^^ it work thanks alot , but theres the limit on the number of picture can be display,
erm i got another question , is there away to put this method in a thread, so i don't need to put it in a timer which is making the program very lag.
public void WestCarOutOfScope()
{
if(picWest2NCar.Location.Y == 0)
{
picWest2NCar.Left = picWest2NCar.Left -260;
picWest2NCar.Top = picWest2NCar.Top +210;
picWest2NCar.Visible = false; picWest2NCar.Image.RotateFlip(System.Drawing.RotateFlipType.Rotate90FlipNone);
picWest2NCar.Refresh();
}
}
|
|
|
|
|
Hello!
I'm not really sure if this is the right place to post this, but i couldn't find any other suiting place eighter so..
Are there any RPG interested people still out there? I've been thinking for some time to start on a new project, a codebase for a new kind of muds (atleast from what i know it's not been done before.. if anybody knows of it, please tell).. the new part would be how it is displayed, it would look similar to ADOM (www.adom.de) or MAngband (www.mangband.org) but with a persistent world beneath.. it's a bit hard to explain in a short post. I'm not sure if it's posible to run it over telnet, it might need a client and it's own protocol.. preferably it would be coded in c#/.net (both server/client). I've been coding for quite some time before, but not much C#/.NET so if anyone feel like giving this a try i would be glad for all kind of help i could get. Just drop me an email or reply to this if you have any more questions!
|
|
|
|