|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
And frankly, you could be doing pretty much anything here!
You need to tell us what you are doing, how you are doing it ("why" as well maybe) and probably show us relevant code fragments so we can see what is going on. At the moment, we are blind - which means we can't help you see either!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Don't post the same question in two places - all you will do is duplicate work and annoy people. Pick either the C# forum or the Q&A and stick with it.
Annoyed people are less likely to be helpful than happy ones...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Can anyone share code for sending emails with and without using third party DLL?
Imran Ahmed
|
|
|
|
|
It sounds like you are ordering at MacDonalds. The forum is mainly aimed at helping with questions, not requests to share code.
People that want to share their code send them in as articles or tricks. The code for sending an email without using a third party dll can be found in the documentation, as well as in several tutorials.
Good luck.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
|
Can anyone share code for code for sending SMS for a mobile number in INDIA with and without using third party DLL?
Imran Ahmed
|
|
|
|
|
|
Only 6 pages[^] of stuff here on CodeProject on that subject
|
|
|
|
|
Hi!
I have one question with working ABCPDF library.
I manually instaled ABCpdf.dll and used on my site.
I copied this dll to my bin folder in project from trial version programm, that was downloaded from http://www.websupergoo.com/download.htm and installed on my computer(i copied ABCpdf.dll, ABCpdf10-32.dll from folder C:\Program Files\WebSupergoo\ABCpdf .NET 10.1 after i have installed it on my computer)
I had to conver pdf file inti tiff, and used this library this way
Doc theDoc = new Doc();
theDoc.Read("C:\\pdf\\" + sec_part + ".pdf");
theDoc.Rendering.ColorSpace = XRendering.ColorSpaceType.Rgb;
theDoc.Rendering.BitsPerChannel = 2;
theDoc.Rendering.DotsPerInchX = 200;
theDoc.Rendering.DotsPerInchY = 400;
int n = theDoc.PageCount;
for (int i = 1; i <= 1; i++)
{
theDoc.PageNumber = i;
theDoc.Rect.String = theDoc.CropBox.String;
theDoc.Rendering.SaveAppend = (i != 1);
theDoc.SetInfo(0, "ImageCompression", "0");
theDoc.Rendering.Save("C:\\pdf\\" + sec_part+".tiff");
}
theDoc.Clear();
it works fine, but...
Is it right? In one month won't the license end and my program stop work?
I really worry about it...
|
|
|
|
|
Talk to the people who created the DLL - they know what their licence covers, and what will happen at the end of the period.
And if it will, then they are the people you will have to pay to keep it working...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Kindly remove registry after 1 month of manual installation or write that command on notepad/Editor and save (.bat) extension like test.bat and run this bat file.
write below code on notepad :
@echo off
cls
echo Deleting WebSuperGoo Registry
echo.
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\WebSupergoo" /F
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\WebSupergoo" /F
pause
:end
|
|
|
|
|
And what does that do?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
="1.0"="utf-8"
<MAIN>
<Items>
<Name>name1</Name>
<Data>data1</Data>
<Category>category1</Category>
</Items>
<Items>
<Name>name2</Name>
<Data>data2</Data>
<Category>category2</Category>
</Items>
<Items>
<Name>name3</Name>
<Data>data3</Data>
<Category>category2</Category>//same category as above
</Items>
...
...
<Items>
<Name>name20</Name>
<Data>data20</Data>
<Category>category16</Category>
</Items>
</MAIN>
Now I need to create an List with category1, category2, ... upto what the categories is there on Category Node, need to create a separate Lists of each category to store the item name and every item list will have data of the item so I can retrieve them for my use.
From above sample xml I need the same category items in a single List
Items and Category count is fully dynamic. How to do this dynamically?
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Please, try to explain again, but this time remembering that we have no context in which to work unless you explicitly tell us!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
You've pretty much answered the question yourself. Whatever deserializes this structure will contain a List<item> collection, and Item will be made up of Name, Data and Category. So, you'll have two classes there:
public class Item
{
public string Name;
public string Data;
public string Category;
}
public class MainList
{
public List<Item> Items = new List<Item>();
}
This space for rent
|
|
|
|
|
I have an example. I think my example can help you.
I have a class
public class Action_Info
{
public string valueResult { get; set; }
public string valueError { get; set; }
public string valueInfo { get; set; }
public long timeWait { get; set; }
}
And a list:
List<Action_Info> listActions;
I have a xml file:
<Script>
<Action>
<Result>Success</Result>
<ErrorReason>None</ErrorReason>
<InfoID></InfoID>
<TimeWait>10941</TimeWait>
</Action>
<Action>
<Result></Result>
<ErrorReason></ErrorReason>
<InfoID>NewRcvXbarRsData</InfoID>
<TimeWait>17666</TimeWait>
</Action>
<Action>
<Result></Result>
<ErrorReason></ErrorReason>
<InfoID>NewRcvXbarRsData</InfoID>
<TimeWait>17953</TimeWait>
</Action>
</Script>
Then I read from xml file to listActions:
XDocument doc = XDocument.Load(filePathXML);
listActions = doc.Descendants("Action").Select(d =>
new Action_Info
{
valueResult = d.Element("Result").Value,
valueError = d.Element("ErrorReason").Value,
valueInfo = d.Element("InfoID").Value,
timeWait = long.Parse(d.Element("TimeWait").Value)
}).ToList();
You can do what you want with your list.
|
|
|
|
|
Assuming:
1. you have deserialized the XML into an instance of a class named 'Main that contains a List<Item>
2. what you want to produce is a Dictionary<string, List<Item>> where each Key in the Dictionary is the Category, and the Value of each Key is a List of those Items with the same Category field value
using System.Linq;
public Dictionary<string, List<ItemTest>> GetItemsByCategory(List<Item> items)
{
return items
.ToLookup(itm => itm.Category)
.ToDictionary(ky => ky.Key, val => val.ToList());
} If you call the method shown here, passing it the list of Items, what is returned is a Dictionary of the Type mentioned in #2 here.
«I want to stay as close to the edge as I can without going over. Out on the edge you see all kinds of things you can't see from the center» Kurt Vonnegut.
|
|
|
|
|
summary (on short)
PageMissing-is an event defined like this (on class called PrinterUserControl):
public event EventHandler<printereventargs> PageMissing;
PrinterEventArgs-inherit from EventArgs and adds info.
Iam trying to activate this code through a main class:
PrinterUserControl CurrentPrinter;//field..
CurrentPrinter.PageMissing+=this.OnPageError;//Placed on method or c`tor
//Here is the error, a very short red line just in the end of this argument saying "} expected"
public void OnPageError(object sender,PrinterEventArgs e)
{
.........
}
What do you think the problem is ?
|
|
|
|
|
You haven't shown enough of your code to be sure, but it looks like you are trying to attach the PageMissing error handler at the class level, not inside a method. This is not allowed. You should attach the OnPageError in the same method where you create and assign the instance of PrinterUserControl .
If this isn't the case, then provide more of the code so we can see what you are actually attempting to do.
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G.K. Chesterton
|
|
|
|
|
Member 12176428 wrote: Here is the error, a very short red line just in the end of this argument saying "} expected" Somewhere in there you have an unpaired {. Go check each brace for a pairing.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I have a queue in serverA, both the wcf service and client are on serverB. How to set the configuration file in this scenario? Everything is working fine if I create a queue in serverB.
|
|
|
|
|
|
I am looking for a good design at how to implement a Windows service which would need to run multiple jobs where each job will talk to different external systems. Like say, When i start the windows service, it should do the following
1. Invoke a process, which would connect to an external system A and perform its job.
2. Invoke another process which would connect to an external system B and perform its job.
3. Invoke another process which would connect to an external system C and perform its job.
What i was mostly interested is, when we start the windows service, if we have any connection exception to any one of the external system, the windows service should still start and connect to the remaining external systems which it was able to connect. In essence, the entire windows service should not go down if the service was not able to connect to any of the external system.
In my current implementation, whenever the windows service starts, i am invoking three different threads for the three external systems and if anyone of them fails , the windows service will not start.
Any inputs to implement the above solution in a better way is appreciated.
|
|
|
|
|
You said it yourself. The service starts and launches a PROCESS. A thread is not a process. It's a thread of execution doing some work.
Your service would be launching processes, separate .EXE's, that stand on their own and do work on their own.
In your current implementation, you're not supposed to be launching threads to do work from inside the code that starts the service. Also, it seems as though each worker is dependent on the same database objects (connection at least), meaning if one fails, they all fail. WRONG! Your design is flawed. Each worker should have it's own SQL support right down to its own SQL connection objects and possibly even connection string. That way they are completely independent of each other.
I've done something similar, but I went with a plug-in system where each plug-in (.dll) is loadable by the service when needed and is unloaded when not. This allows me to have each plug-in talk to the service for logging and exception handling purposes and also allows me to swap out .dll's without shutting down the entire service.
No, I'm not sharing the code with anyone. I put way too much work into it to give it away for free.
Hints: I used Log4Net, a custom log forwarder to cross AppDomain boundries, TopShelf, a heavily modified version of the Simple Plugins Framework from a SourceForge project, a custom scheduling engine and a new configuration module.
|
|
|
|