.net

What files are mandatory in release windows form?

一世执手 提交于 2021-02-07 14:55:24
问题 I have files in ...bin/release where is my windows form application, I have used EEPlus library as well. What the files do I need to send to client to have application work correctly? My files: name.exe name.exe.config name.pdb name.vshost.exe name.vshost.exe.config name.vshost.exe.manifest EEPlus.dll EEPlus.xml I know that first two are mandatory, but what about all rest? thanks in advance 回答1: name.exe //necessary, it is your main executable name.exe.config //necessary, it is your

Download animated GIF

橙三吉。 提交于 2021-02-07 14:52:17
问题 I'm using the below to grab an animated gif off the web. However, upon saving this to disk, I lose the frames in the gif, and it no longer animates. Not sure whether the problem is in the below method, or whether it's when I'm saving it, but any feedback on why the below wouldn't work appreciated. The method is working - just not creating a proper animated gif file. public Image getImage(String url) { HttpWebRequest httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url); HttpWebResponse

.NET DateTime to String

落花浮王杯 提交于 2021-02-07 14:52:01
问题 Is there a easy way to convert a DateTime object to a string representation like this '2010-03-03 10:38:48'. I'm not sure what the above format is but it is different from the patterns obtainable via ToLongTimeString() etc. Is this a case for string builder? 回答1: Like this: date.ToString("yyyy-MM-dd hh:mm:ss") If you want 24 hour time, replace hh with HH . For more information, see here. 来源: https://stackoverflow.com/questions/2368253/net-datetime-to-string

Why does DriveInfo.GetDrives() not get network mapped drive in windows service

牧云@^-^@ 提交于 2021-02-07 14:51:17
问题 I have a windows service developed in .NET C# using VS 2010, I'm calling the DriveInfo.GetDrives() but it is not getting the Z: drive (a mapped network drive), I did some googling and found some results pointing to windows account privileges, so I have tried all account types of service installer such as LocalSystem, User, LocalService, NetworkService but none worked and I still can't get the drive Z: . I did another test, debugging the windows service (as a console application) and I can get

Why does DriveInfo.GetDrives() not get network mapped drive in windows service

偶尔善良 提交于 2021-02-07 14:51:04
问题 I have a windows service developed in .NET C# using VS 2010, I'm calling the DriveInfo.GetDrives() but it is not getting the Z: drive (a mapped network drive), I did some googling and found some results pointing to windows account privileges, so I have tried all account types of service installer such as LocalSystem, User, LocalService, NetworkService but none worked and I still can't get the drive Z: . I did another test, debugging the windows service (as a console application) and I can get

Download animated GIF

一世执手 提交于 2021-02-07 14:50:35
问题 I'm using the below to grab an animated gif off the web. However, upon saving this to disk, I lose the frames in the gif, and it no longer animates. Not sure whether the problem is in the below method, or whether it's when I'm saving it, but any feedback on why the below wouldn't work appreciated. The method is working - just not creating a proper animated gif file. public Image getImage(String url) { HttpWebRequest httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url); HttpWebResponse

.NET DateTime to String

99封情书 提交于 2021-02-07 14:50:33
问题 Is there a easy way to convert a DateTime object to a string representation like this '2010-03-03 10:38:48'. I'm not sure what the above format is but it is different from the patterns obtainable via ToLongTimeString() etc. Is this a case for string builder? 回答1: Like this: date.ToString("yyyy-MM-dd hh:mm:ss") If you want 24 hour time, replace hh with HH . For more information, see here. 来源: https://stackoverflow.com/questions/2368253/net-datetime-to-string

Internal applications - why not make everything public?

青春壹個敷衍的年華 提交于 2021-02-07 14:46:55
问题 Is there a reason why I should not be marking everything as public in our intranet reporting app? No one outside out co will ever have access to this code - we have about 20 projects - mostly small and specific. Is there really a reason why we should be marking things anything other than public? I have my own thoughts on this which I'm trying to omit as I want this to be unbiased. (I have sexed up the title slightly) 回答1: Look up Encapsulation and/or "Information Hiding": In object-oriented

Can I edit Resource file at runtime

霸气de小男生 提交于 2021-02-07 14:44:42
问题 I have a WCF service, it response with JSON. I need to create a language file, which I can edit on production server. no problem if I will need to recycle App pool. I was about to use Resource file, but I was worry that it is not editable by end user. I don't need to edit it pragmatically, the end user will edit it by opening the file in notepad without recompiling the application. What do you suggest? Thanks 回答1: Yes you can using the ResXResourceWriter class. If you need to generate the

Can I edit Resource file at runtime

白昼怎懂夜的黑 提交于 2021-02-07 14:43:39
问题 I have a WCF service, it response with JSON. I need to create a language file, which I can edit on production server. no problem if I will need to recycle App pool. I was about to use Resource file, but I was worry that it is not editable by end user. I don't need to edit it pragmatically, the end user will edit it by opening the file in notepad without recompiling the application. What do you suggest? Thanks 回答1: Yes you can using the ResXResourceWriter class. If you need to generate the