|
That's an Android app. Are you sure this is a C# issue?
|
|
|
|
|
COder876 wrote: I want to develop Windows App for NGO Sounds like a good idea. Please come back here with specific technical questions related to your progress in programming your application using C#.
And, be sure and visit other CP forums, like the Database forum, to ask questions about the other issues with the application.
«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.
|
|
|
|
|
My code is failing on the following line.
this.buCursor.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("buCursor.BackgroundImage")));
Because appears that
resources.GetObject("buCursor.BackgroundImage")
Is returning NULL or some value that is causing the application to throw a
"'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll
Additional information: MissingManifestResourceException"
Putting a watch on buCursor I see that the BackgroundImage element value says "Could not evaluate expression"
A bit more background is the code runs no problem on a Windows CE5.0 application with C# code developed in VS 2005.
I created a new SDK for a new target we are going to use, for Windows Embedded Compact 13 using VS2013 and application builder. This runs basic test C# applications, developed in C#, I have built for it.
I created new device application C# project in VS 2013, based on the SDK I made, and added the source code and resources from the VS2005 project.
After building the VS2013 code and debugging it, it throws this exception.
I used "Run Custom Tool" on resources.resx.
I also ensured .resx files and other resources were "Embedded Resources"
Any help would be greatly appreciated.
Thank you.
|
|
|
|
|
|
It could also be that you need to copy the files themselves (images) from the source solution, and put them in the exact same folder (the resource manager holds a reference to the file added to the .resx).
I never finish anyth
|
|
|
|
|
hi
i have DataSet that contain Image.
i need to save this Image to File.
i try this:
SQL = ItemCode,PIC from ROW;
dsView = new DataSet();
adp = new SqlCeDataAdapter(SQL, Conn);
adp.Fill(dsView, "ROW");
adp.Dispose();
foreach (DataRow R in dsROW.Tables[0].Rows)
{
ItemCode = R["ItemCode"].ToString().Trim() ;
TEMP = R["PIC"].ToString().Trim();
Image image = R["PIC"] as Image;
if(image != null)
{
MemoryStream ms = new MemoryStream();
image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] imagedata = ms.ToArray();
}
but image Always is null
and in TEMP i see System.Byte[]
need some help, thanks
|
|
|
|
|
|
thank for the help !
i try this and i got: InvalidCastException
i work on C# Windows-Mobile
thanks
|
|
|
|
|
That means the field is not a blob (thus, it can't be converted to a byte array). Please check the data type of your "pic"
Best,
John
-- LogWizard Meet the Log Viewer that makes monitoring log files a joy!
|
|
|
|
|
How to get data(json) to listview by MVVM?
Inside View:
<Grid>
<ListView x:Name="lsvItems" VerticalAlignment="Top" HorizontalAlignment="Stretch">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsWrapGrid Orientation="Horizontal"></ItemsWrapGrid>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel>
<Grid>
<Ellipse Stroke="Black" Width="180" Height="180" StrokeThickness="0.9" Margin="0,5">
<Ellipse.Fill>
<ImageBrush ImageSource="/Asets/nologo.jpg"></ImageBrush>
</Ellipse.Fill>
</Ellipse>
<Ellipse Stroke="Black" Width="180" Height="180" StrokeThickness="0.9" Margin="0,5">
<Ellipse.Fill>
<ImageBrush ImageSource="{Binding thumbail}"></ImageBrush>
</Ellipse.Fill>
</Ellipse>
</Grid>
<StackPanel Margin="0,5">
<TextBlock Text="{Binding title}" Foreground="White" FontWeight="SemiBold" OpticalMarginAlignment="TrimSideBearings" TextTrimming="CharacterEllipsis" FontSize="15" Margin="2" ></TextBlock>
<TextBlock Text="{Binding user.full_name}" Foreground="White" FontSize="12" Margin="2"></TextBlock>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
Inside Model:(tracksModel.cs)
...........
public class Track
{
public string urn { get; set; }
public string uri { get; set; }
public string permalink { get; set; }
public string permalink_url { get; set; }
public string title { get; set; }
public string description { get; set; }
public string track_type { get; set; }
public string genre { get; set; }
public string tag_list { get; set; }
................
}
public class RootObject
{
public List<Track> tracks { get; set; }
public string tag { get; set; }
public string next_href { get; set; }
}
Inside ViewModel:
StaticMethod:
public class StaticMethod
{
public static async Task<string> GetJsonStringTask(string link)
{
HttpClient client = new HttpClient();
HttpResponseMessage message = await client.GetAsync(link+ "&client_id=9ac2b...");
string result = await message.Content.ReadAsStringAsync();
return result;
}
}
TrackViewModel:
public ObservableCollection<TracksModel> TrackCollection = new ObservableCollection<TracksModel>();
public async Task GetTrackAsyncTask(string link)
{
var result = await StaticMethod.GetJsonStringTask(link);
if(result!=null)
{
**var getItem = JsonConvert.DeserializeObject<TracksSoundCloud.RootObject>(result);
if(Do not get a error)
{ give data to listview}
else
return a error and show up on listview or show messagebox.
}**
}
Please help me to fix it? I'm new on MVVM.
var getItem = JsonConvert.DeserializeObject<TracksSoundCloud.RootObject>(result);
if(Do not get a error)
{ give data to listview}
else
return a error and show up on listview or show messagebox.
}
|
|
|
|
|
What exactly is the problem?
|
|
|
|
|
I did not get data.
binding trackcollection but no have data.
|
|
|
|
|
If it not mvvm then
lsvitem.itemsource=getitem.track;
but this is mvvm so I don't know .
|
|
|
|
|
I can't seem to find any way to get a GUI in Cosmos OS. I have went on Youtube, Stacks, and more. I did not find any methods that work. If anyone can please help me that would be awesome! Thanks in advanced!
|
|
|
|
|
What does this have to do with C#?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Believe it or not, Cosmos has something to do with C#; but, yes, this question here is way-off this forum's scope.
"Cosmos is an operating system "construction kit", built from the ground up around the IL2CPU compiler in C# and our home-brewed language called X#." [^]
«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.
|
|
|
|
|
Thank you. I learn from CP every day!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Enjoy[^]
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Cool ! I should never underestimate the content on CodeProject
«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.
|
|
|
|
|
It has quite a few unexpected articles, yes
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
so here I'm trying to use proxies from a listView in my project. But I have no clue and have had no experiences in using proxies in C# before nore in any other form of anything haha.
So what I've got so far is a button to import a .txt file of "proxies" and it adds the items to a listView.
From there I'm wanting a loop in my proxy state so it runs through the listView of proxies.
I have no clue on what I'm doing here so would need some extended support here. In need of this for a college project.
Here is my post data.
CookieContainer cookieCon = new CookieContainer();
public string postRequest(string url, String postData, String Username, String Password)
{
try
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
request.Method = "POST";
request.CookieContainer = cookieCon;
request.ContentType = "application/json; charset=utf-8";
request.Headers.Add("Cookie", "devicecookie=146.200.41.147.1446567416483.346;");
request.UserAgent = "FireFox User Agent";
request.Headers.Add("Accept-Language", "en-GB,en-US;q=0.8");
request.Host = "www.collegename.co.uk";
request.Headers.Add("Accept-Encoding", "gzip");
request.KeepAlive = true;
byte[] byteArr = Encoding.Default.GetBytes(postData);
request.ContentLength = byteArr.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArr, 0, byteArr.Length);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
string source = reader.ReadToEnd();
return source;
}
catch (Exception ex)
{
if (ex.Message.Contains("401"))
{
}
}
return null;
}
Would appreciate it if you could give me some help here, thanks guys. I'm not looking to change a mass amount of my code but would appreciate some help.
|
|
|
|
|
Member 11367553 wrote: I have no clue on what I'm doing here Exactly what are you trying to do with these proxies? And more importantly, are you sure this is a good choice of college project?
|
|
|
|
|
It's to login and yes it's a good choice of college project because it's what we have been asked to do.
|
|
|
|
|
Member 11367553 wrote: It's to login What exactly is that supposed to mean?
|
|
|
|
|
It's posting to the student login page, our project is to utilize proxies in a project so this is what I'm doing.
|
|
|
|